Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I put GIF/PNG/... image on a BitBtn in Delphi?

I'm using Delphi 2007. How can I put a GIF/PNG image on a BitBtn component? (Preferably, with alpha transparency supported)

like image 943
delphist Avatar asked Oct 26 '08 22:10

delphist


3 Answers

Use a graphics program like Photoshop (or something less expensive) to convert the images to bitmaps. BitBtns don't accept GIF or PNG images.

like image 74
Kluge Avatar answered Nov 12 '22 02:11

Kluge


PngComponents pack has a component named PngBitBtn wich can display correctly PNG's with alpha transparency. They are somewhat old, but they can be installed under Delphi 2007 with a little work.

like image 39
Attila Szasz Avatar answered Nov 12 '22 03:11

Attila Szasz


PNG support is only fully supported by Delphi 2009. There is a freeware package (licensed as MPL 1.1) named GraphicEx which will allow you to load the images at design time/runtime, but you will not get the alpha blended transparency on the button in Delphi 2007.

like image 2
skamradt Avatar answered Nov 12 '22 01:11

skamradt