Link to home
Start Free TrialLog in
Avatar of WoodyJ007
WoodyJ007

asked on

Image Transparency

Hi guys,
   Does anyone know of a component that allows transparency for images other than .bmp's?

Setting Transparency to true when a bitmap is loaded into a TImage component makes it transparent.  I need to do this to another image format (bitmaps are just too big to store).  Any suggestions on components and what image format to use (png, jpeg etc).
Avatar of kretzschmar
kretzschmar
Flag of Germany image

you could use jpg and assign the
jpg as bitmap into the
timage.picture.bitmap-property like

jpgobject.loadfromfile('AFilename');
image1.picture.bitmap.assign(jpgobject);
//do your transparency now

meikl ;-)
Avatar of WoodyJ007
WoodyJ007

ASKER

I've found that converting from jpegs to bitmaps is slow and never a perfect conversion.

I'm writing some software that will have thousands of images that some of which will overlay on each other.  I need it to be as quick as possible and storage (in SQL server) to be as small as possible.

I was thinking of using Png's but I'm not sure on performance.
>I've found that converting from
>jpegs to bitmaps is slow and never
>a perfect conversion.

depends on how big is the image and
how was the compression<->quality ratio

for png you need a converter for display,
for this look for the graphicEx lib
from mike lischke at www.lischke-online.de

meikl ;-)

OK.  I think I've decided on pngs but the graphicEX lib seems to be looking for jpg.pas.  The DCU is there but it still won't run.

I'm using Delphi6 so maybe the dcu was complied under another version and isn't compatible.

Does anyone have the source for jpg.pas ??

cheers
add JPEG to uses
I've already tried that.  It throws loads of compiler errors.  jpg.pas and jpeg.pas must be different.
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Spot on!  Thanks.

It adds png support to the standard controls which make my life loads easier.

Cheers
Woody.
Spot on!  Thanks.

It adds png support to the standard controls which makes my life loads easier.

Cheers
Woody.