Page 1 of 1

Invisible Colors on TImage

PostPosted: June 6th, 2006, 1:02 pm
by Codius
I've been searching for a while following tutorials all over the internet, but whatever I do it wont work as I want it to.
It'll either hide everything or nothing.

What I want to do is to have 2 "layers" of Images, the first layer will be "solid", with no transparency. The other however will contain details and such, this layer need an "invisible color" like pink or so that is not to be displayed..

First I tried to use gif, but Delphi7 doesn't accept gif - something with copyright? So now I'm using .jpg files - but can't get an invisible color!
Is this even possible? if it is, how can I do this?

Thanks in advance!
Yours, Codius!

PostPosted: June 6th, 2006, 3:27 pm
by Johnny_Bit
try component that enables gif transparency for delphi, like eg. TGIFFile etc... Tons can be found on sites like torry or such, just search.

PostPosted: June 6th, 2006, 4:03 pm
by Kambiz
JPEG doesn't support transparency.

You can use Bitmap or PNG as replacement for GIF.

Delphi doesn't support PNG natively. Use GraphicEX Library for PNG (and many other image formats) support.

PostPosted: June 6th, 2006, 4:09 pm
by Codius
I got the GraphicEx to work, and it's nice!
But am I doing something wrong or it doesn't support more then 256 colors? I couldn't find any information about it in the manual that came with it.

--------------------
Old posts, nevermind them:
--------------------
But is there no way to tell delphi that every pixel thats colored with "FF0000" for example - will be invisible?

I guess PNG would work aswell, possibly better then JPG..
But I'm having a problem when I try to use the GraphicEx stuff (never included something like that before) - It's complaining about GraphicEx.dcu not existing?

PostPosted: June 6th, 2006, 6:12 pm
by HPW

PostPosted: June 6th, 2006, 8:34 pm
by Codius
HPW wrote:I use for PNG: http://pngdelphi.sourceforge.net/


Thanks alot! This worked great!

PostPosted: June 6th, 2006, 11:39 pm
by Kambiz
HPW,

I didn't know about this library, thank you.

Cheers