Announcement

Collapse
No announcement yet.

NN bitmaps in same picture box ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NN bitmaps in same picture box ?

    Is it technically possible to display more than one bitmap in the same picture box ? If yes, I would very greatly appreciate code snippet showing how to accomplish this, with control over positioning of each bitmap inside the box .

    Robert

    -------------
    Robert Lightbourne
    Bob Lightbourne

  • #2
    Yes it is quite possible. I don't have any example code, but the general technique is straight forward. I like to use a LABEL control with the %GRAY_FRAME style to emulate a "picturebox", and then I display my images in response to %WM_PAINT events.

    Assuming that you have your bitmaps loaded into memory DC's, use StretchBlt() to bit-block-transfer the bitmap into the DC of the control, only giving each bitmap the amount of room it is required to have.

    For example, if we have a control that is 100 units x 100 units, we could display one hundred 10x10 images... just give StretchBlt() the starting location in the DC of the LABEL control (the target), and tell it to use a width and height of 10 units.

    Clear as mud? This is probably a bit too complicated to describe briefly but good books like Petzold cover this stuff in great detail. See the FAQ forum for ISBN details.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X