Re:

new topic     » goto parent     » topic index » view thread      » older message » newer message

> 2. Part of the bitmap there is an LED. Is there a way I can make it
> appear to blink on a mouse click without loading a whole second bitmap.

That sounds pretty easy, as long as you're not stretching the bitmap.

For this, I'll assume the LED is "ON" in the bitmap, and that you know
the dimensions of the LED (x, y, cx, cy) in the bitmap. Remember, (0,
0) is the upper-left corner of the bitmap/window, and cx and cy are
the width and height.

1. Create a Pixmap the size (cx, cy) of the LED, name it LedOff or somethin=
g
2. Draw the "OFF" image onto the Pixmap
3. Create another Pixmap (same size) and bitBlt the LED "ON" image
from the bitmap onto it, name it LedOn or something
4. When the mouse event or whatever occurs, copyBlt the LedOff Pixmap
to the (x, y) position on the window over the bitmap, then copyBlt the
LedOn Pixmap back when needed

Note on bitBlt vs copyBlt: The reason you need to use bitBlt on #3 is
because you have to grab only *part* of the bitmap, whereas you're
copying the entire Pixmap in #4. Just thought I'd clear that up ahead
of time.

~Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu