AnsweredAssumed Answered

VRf-Updating_Bitmaps

Question asked by VRFuser on Jul 13, 1996
from: Greg Goebel / HP-MXD
      gvg@lvld.hp.com / 970-679-3030 / FAX 970-679-5971
to:   VRf / Paul Thomas
date: Sunday, 14 July 1996 1233 MDT

Regarding updating bitmap-reloading on VEE ... in principle it seems
straightforward; hopefully this reflects reality, if not we will need more
details.

[%%] regards -- gvg



[VEE] VEE BITMAP DISPLAY UPDATES

* A customer had a VEE application that displayed a bitmap in a popup panel
... the customer was using it to view data from an external device.  This
worked fine -- except that the VEE program would continue to show the same
bitmap until it was rerun, even though new bitmaps were generated.

Obviously, VEE was loading the bitmap at prerun (or whatever) and did not
need to load it again during the execution of the program.  I wrote the
following small program to test:

   +-------+
   | Start |
   +---+---+
       |
   +---+---+
   | Until |
   | Break +--+------+
   +-------+  |      |
              |   +--+--+
              |   | OK  +-----+
              |   +-----+     |
              |               |
              |       +-------+-------+
              |       | Call Function |
              |       +---------------+
              |       |   setpix()    |
              |       +-------+-------+
              |               |
              |           +---+---+
              +------+    | Next  |
                     |    +-------+
                     |
                  +--+--+
                  | OK  +-----+
                  +-----+     |
                              |
                          +---+---+
                          | Stop  |
                          +-------+

The "setpix()" UserFunction was quite simple:

   +--------------------------------------+
   |              setpix()                |
   +--------------------------------------+
   |                    +---------+       |
   |                    | Picture |       |
   |                    +---------+       |
   |                    |         |       |
   |                    |         |       |
   |                    |         |       |
   |                    +----+----+       |
   |                         |            |
   |                      +--+--+         |
   |                      | OK  |         |
   |                      +-----+         |
   |                                      |
   +--------------------------------------+

I arranged it so that it would "Show Panel On Execute" and gave it the
pop-up appearance:

   +-------------------+
   |    +---------+    |
   |    | Picture |    |
   |    +---------+    |
   |    |         |    |
   |    |         |    |
   |    |         |    |
   |    +---------+    |
   |                   |
   |      +-----+      |
   |      | OK  |      |
   |      +-----+      |
   +-------------------+

I gave the Picture object the filename "test.bmp" for a file to display ...
I ran the program, displayed the bitmap, got rid of it, used PaintBrush to
change the bitmap, displayed the bitmap again ... and it was the same, as I
expected.

The answer was to bring out the "file" data input pin and the "clear" control
input pin on the Picture object:

   +--------------------------------------+
   |              setpix()                |
   +--------------------------------------+
   |  +----------+   +-----------------+  |
   |  |   Text   |   |     Picture     |  |
   |  +----------+   +-------+---------+  |
   |  | test.bmp +-->| file  |         |  |
   |  +----------+   |       |         |  |
   |                 |       |         |  |
   |             +-->| clear |         |  |
   |             |   +-------++--------+  |
   |             |            |           |
   |             |         +--+--+        |
   |             |         | OK  +--+     |
   |             |         +-----+  |     |
   |             |                  |     |
   |             +------------------+     |
   |                                      |
   +--------------------------------------+

This worked fine ... I displayed the bitmap, got rid of it, changed it in
PaintBrush, displayed it again ... and got the new bitmap.

I originally designed the UserFunction to ping the "clear" pin first and then
load the file name, but this generated a flicker when the object was first
displayed; so I rewired it so that it would clear the Picture object when
the UserFunction was exited, and then reload the bitmap the next time it was
invoked.  Other requirements may demand a different usage, but in any case
the program must clear the Picture object and then load it again so that it
will be updated.

[<>]

Outcomes