User | Post |
sloat
Posts: 84/85 |
Try finding info on TransparentBlt for vb. That will copy a memory bitmap to a DC (if the picbox has a DC property) and mask out a given color as transparent.
Just do not use it on Windows 98. There is a known memory leak, and it will really screw stuff up. |
Mega-Dog
Posts: 109/139 |
no PNG no LoadImage...
Has to be a Bitmap...nothing else... |
knuck
Posts: 1604/1818 |
PictureBox doesn't support PNG. |
HyperLamer
Posts: 7389/8210 |
LoadImage might do the trick. If you use the LR_LOADTRANSPARENT flag, the top left pixel defines a transparent colour. Any instance of that colour in the image is replaced with the default window colour. It only works with 256-colour images, but GIFs are 256 colours anyway. (I'm pretty sure it can load a GIF/JPG/PNG.) |
Mega-Dog
Posts: 107/139 |
Hey I have recently been trying to make a bitmap transparent...via setting the menu color in so I can have Menu Bitmaps in VB. Only problem is I have not found any good code. I am wondering if someone has a demo of some code they can share with me to render these Bitmaps fast. I have tried stuff like this but it dithers and screws up the colors:
PicBmp (image is a GIF with Transparency)
picBmp.BackColor = GetSysColor(4) 'Set Color to Windows Menu System Color picBmp.Picture = picBmp.Image
any suggestions? |