PDA

Click to See Complete Forum and Search --> : Adding 2 bitmaps together


VB6Coder
May 11th, 2001, 08:32 AM
I've got two bitmaps in an image list control, and I need to add them together to create one bitmap. This bitmap will then be used to set the MaskPicture property of a user control. I can't use the Overlay method of the Image List control as the bitmap positions could change.

How do I add two bitmaps together to make one bitmap and still keep it as a Picture object?

amitabh
May 11th, 2001, 08:34 AM
Use the BitBlt api call

VB6Coder
May 11th, 2001, 08:45 AM
BitBlt draws the bitmaps onto a DC. How do I get a handle to the bitmap on the DC, so I can use it with the OleCreatePictureIndirect API to get a Picture object?

Megatron
May 11th, 2001, 02:27 PM
Well, once it's draw on the DC, you can access it from the Image property. If you want to access it from the Picture then simply set the Picture to the Image.

Picture1.Picture = Picture1.Image

Megatron
May 11th, 2001, 02:36 PM
Also, don't forget to refresh your graphics (Picture1.Refresh), otherwise they will not show.