Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - VB Transparent Bitmaps...
  
User name:
Password:
Reply:
 

UserPost
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?
Acmlm's Board - I2 Archive - Programming - VB Transparent Bitmaps...


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.002 seconds.