Page 1 of 1
Graphics w/Transparent Backgrounds
Posted: Mon Mar 06, 2006 12:53 pm
by Gnome
:roll: I'm a complete newbie and am trying to learn PureBasic. I've searched the forums but cannot find an answer (much less a simple one) that will tell me how to do the following ... please help:
I'm using the "Image Gadget" in the Visual Designer to get a graphic. If the image done in Photoshop has a transparent background, why wouldn't it in in designer?
What do I need to get rid of any background colors on images?
Many thanks to all in this great forum!
Kevin.
Posted: Mon Mar 06, 2006 1:12 pm
by netmaestro
Hello, Gnome:
If you use a .png image or a .tiff image, alpha transparency will be displayed correctly when you use the command DrawAlphaImage() to display the graphic. You will have to use the appropriate decoder as well:
Code: Select all
UsePNGImageDecoder()
CatchImage(0, ?pic)
OpenWindow(0,0,0,320,240,#PB_Window_SystemMenu,"My Window")
StartDrawing(WindowOutput(0))
DrawAlphaImage(ImageID(0),0,0)
StopDrawing()
Repeat
EventID=WaitWindowEvent(1)
Until EventID=#PB_Event_CloseWindow
DataSection
pic: IncludeBinary "MyImage.png"
EndDataSection
afaik the ImageGadget doesn't manage alpha transparency for now (I think)
Posted: Mon Mar 06, 2006 6:22 pm
by Gnome
Thank you for your fantastic help ... I shall try it out as soon as possible!
May I ask what you mean by 'alpha transparency?'
And, say I use a .TIF or .PNG image ... what do I do with these graphics? (i.e., make a clipping path?, remove the background in Photoshop so that it's transparent?, save it any particular way?)

Thank you again for your most appreciated help!
Regards,
Kevin.
Posted: Mon Mar 06, 2006 8:03 pm
by Straker
Gnome wrote:May I ask what you mean by 'alpha transparency?'

http://en.wikipedia.org/wiki/Alpha_transparency
Gnome wrote:remove the background in Photoshop so that it's transparent?, save it any particular way?
Yes
THANKS!
Posted: Mon Mar 06, 2006 8:49 pm
by Gnome

I'm humbled by the great support that everyone provides within this forum. Thank you!
Posted: Wed Oct 04, 2006 12:22 am
by garretthylltun
What about for toolbar images and image buttons?
-Garrett
Posted: Wed Oct 04, 2006 12:07 pm
by Trond
For those use 32-bit icons.
Posted: Wed Oct 04, 2006 12:07 pm
by Inf0Byt3
You can allways use transparent background icons to make them look professiional

.