Click to See Complete Forum and Search --> : REALLY Transparent?
SteveCRM
Dec 3rd, 1999, 02:35 AM
Is there a way to make an image transparent. Like you can see an image behind it?
Thanks,
Steve
PhilipG
Dec 4th, 1999, 12:15 AM
Steve, I belive the only way to achive that effect is with OpenGL or another graphics programming library. There are several OpenGL Visual Basic Programming sites out there to go into this.
I could be wrong!
------------------
HTH,
Philip
phgarman@home.com
SmashingPumpkinsAddict
Dec 4th, 1999, 02:23 PM
No, No, children, do not use OpenGL. I never have but I'm sure its complicated. What you need to do is use the BitBlt API call. Read up on it (ie obtaining the Microsoft SDK by searching for BitBlt at www.microsoft.com/vbasic/ (http://www.microsoft.com/vbasic/) (actually, that is not the URL, but it was the old VB page and should take you to the new)). You can make the white parts of the image transparent by ANDing it over the other image or you can make the black parts of the image transparent by ORing it onto the other image.
-Adam
SteveS
Dec 5th, 1999, 09:39 AM
Actually, by Creating a "Mask" image. Then using "SmashingPumpkinsAddict" idea, you can actually get perfect Transparent colours, yes colours plural.
Eg. Create a Bitmap half white and half black the same size and shape as your actual bitmap, then XOr this to the background, then XOr your actual bitmap.
This will make parts of your Bitmap "Tansparent"
Hope this helps,
Steve.
I may be being naive here, but is all that messing really necessary?!
Why don't you just use a GIF image? VB removes any transparent areas for you all by itself...ain't that nice?
They look a bit sloppy when they load, mind...
------------------
Matthew Ralston
E-Mail: m.ralston@mediavault.co.uk
ICQ:31422892 (http://www.thebluelink.cjb.net/icq.html)
Web Sites:The Blue Link (http://www.thebluelink.cjb.net) My Home Page (http://mralston.cjb.net)
Gimpster
Dec 6th, 1999, 12:59 AM
Actually, matthewralston, you're close, but a little clarification is in order. You need to have a picture in what they call "GIF89" format. This is what makes the image transparent around the edges, or basically wherever you haven't already put color. A great program for this is Adobe's Photoshop. Not only is it a VERY powerful tool, but all you have to do to make a transparent gif is export the file in the GIF89 format. It's that simple, that's how they do it on a web page. And VB recognizes the transparent gif coding, so it displays it just the same. I believe you can download a free demo of Photoshop from Adobe's site. And that's all you will need to do it.
------------------
Ryan
corneslen@hotmail.com
ICQ# 47799046
SteveCRM
Dec 6th, 1999, 01:54 AM
Actually I am buying photoshop tomorrow. But will that make the actual image part transparent? So I could see through a rocket ship, to see what is behind it, while still seeing it?
Steve
SmashingPumpkinsAddict
Dec 6th, 1999, 03:26 AM
Yes, you can use GIF89 if you want to do a transparent image...that is, if you have VB5 or better. Which not all of us have (i.e. ME). Anyway, you're much better off using Bitblt, because its faster, and the VB image control is pretty slow updating, especially on slower computers. And if you ever want to port your app to WinG or another faster graphics system, it will be much easier if its already in the semi-standard Bitblt format.
-Adam
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.