Can anybody explan the function TransparentBlt()?
-
Hi Ilavl, Perhaps you can provide which TransparentBlt() function your using? There is two that I know of. The class CDC has one, CImage has one also and they both take different parameters. Also one of them has a bad memory leak that can render the system useless. Off the top of my head I can't remember which one or if MS has fixed this or not. A quick search on http://msdn.microsoft.com/ should help. Let me know and I'll help you out. Cheers :)
-
TransparentBlt can be used to paint a picture from one DC (the source) to another (the destination). The special thing about it is, that you can designate a specific color to be transparent. Any pixel on the source DC with that specific color, will not be copied. It purpose was to supersede older BitBlt hassle with masks. if you have a DC ready with an image you want to place on a windowDC, and this image has the color black designated as transparent, this code would probably work: In your message handler: case WM_PAINT: TransparentBlt( (HDC) wParam, // your window DC 0, // Dest. x 0, // Dest. y 220, // width of picture on destination 440, // height of picture on destination hdcSrc, // Source DC 0, // Source x 0, // Source y 220, // width of picture on source 440, // height of picture on source RGB(0,0,0) // Macro, specifies the color black ); if source and destination heights and widths differ, TranparentBlt stretches the source image to fit the size specified for the destination... If you need more help concerning this, you could, if you like, email me the piece of source you're having trouble with... Georg Haan (.Netherlands)
-
TransparentBlt can be used to paint a picture from one DC (the source) to another (the destination). The special thing about it is, that you can designate a specific color to be transparent. Any pixel on the source DC with that specific color, will not be copied. It purpose was to supersede older BitBlt hassle with masks. if you have a DC ready with an image you want to place on a windowDC, and this image has the color black designated as transparent, this code would probably work: In your message handler: case WM_PAINT: TransparentBlt( (HDC) wParam, // your window DC 0, // Dest. x 0, // Dest. y 220, // width of picture on destination 440, // height of picture on destination hdcSrc, // Source DC 0, // Source x 0, // Source y 220, // width of picture on source 440, // height of picture on source RGB(0,0,0) // Macro, specifies the color black ); if source and destination heights and widths differ, TranparentBlt stretches the source image to fit the size specified for the destination... If you need more help concerning this, you could, if you like, email me the piece of source you're having trouble with... Georg Haan (.Netherlands)
Hello Georg, Do you know how can i draw transparent image with IPicture object ? Please help me ... My month article: Game programming by DirectX by Lan Mader. Please visit in: www.geocities.com/hadi_rezaie/index.html Hadi Rezaie