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... | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Mega-Dog

Level: 20

Posts: 107/139
EXP: 40051
For next: 2388

Since: 03-15-04
From: Minnesota

Since last post: 8 days
Last activity: 4 days
Posted on 10-02-05 03:44 PM Link | Quote
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?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 7389/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-02-05 10:38 PM Link | Quote
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.)
knuck

Hinox
Banned until 19-58-5815: trolling, flaming, spamming, being a general fucktard...
Level: 62

Posts: 1604/1818
EXP: 1894574
For next: 90112

Since: 03-15-04

Since last post: 14 hours
Last activity: 9 hours
Posted on 10-02-05 10:58 PM Link | Quote
PictureBox doesn't support PNG.
Mega-Dog

Level: 20

Posts: 109/139
EXP: 40051
For next: 2388

Since: 03-15-04
From: Minnesota

Since last post: 8 days
Last activity: 4 days
Posted on 10-03-05 03:57 AM Link | Quote
no PNG no LoadImage...

Has to be a Bitmap...nothing else...
sloat

Level: 16

Posts: 84/85
EXP: 18044
For next: 2212

Since: 05-21-04
From: South Central Delaware

Since last post: 19 days
Last activity: 5 hours
Posted on 10-06-05 09:57 AM Link | Quote
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.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
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.013 seconds.