1.

Solve : Delphi/pascal transparent TImages or objects?

Answer»

Hi,

I want to know how to make a TImage in DELPHI/pascal transparent. I do know that there is a property that allow you todo this but thats not what im after. I want to beable to make the transparancy have levels e.g level 0 is fully visable, level 5 is half visable and level 10 is transparent/invisable.

Just if you want to know i use delphi 7 or dev-pascal

Thx,
Tan_ZaQuote from: Tan_Za on September 28, 2010, 12:42:43 AM

Hi,

I want to know how to make a TImage in delphi/pascal transparent. I do know that there is a property that allow you todo this but thats not what im after. I want to beable to make the transparancy have levels e.g level 0 is fully visable, level 5 is half visable and level 10 is transparent/invisable.

Just if you want to know i use delphi 7 or dev-pascal

Thx,
Tan_Za
The word you are looking for is Translucency, (transparent=fully see through, translucent means it's partially see-through, as you want).

Word semantics aside, a google turned up this thread:

http://stackoverflow.com/questions/2998069/delphi-image-with-alpha-blending-capabilities

Quote
The basic TImage is capable of displaying a PNG image and alpha-blend-it to whatever is BEHIND it. You just need to add the "pngimage" unit to the uses clause of your form. You didn't mention the version of Delphi you're on: Delphi 2010 has this unit, but I have no idea with what version of Delphi they started shipping it. For Delphi 7 I know for sure you'll need to FIND the open source "pngimage".

If you need to do this when the user moves in and out of your control, CONSIDER caching the state images in bitmaps: it will be faster at runtime and you can use a single TImage that shows the current image, you don't need two overlapping TIMage controls.

I believe they are referring to PNGDelphi.

The information that you gave me was GOOD but it was more based around making forms alpha blend not images or objects, if you have anymore ideas it would be greatly welcomed..

Regards,
Tan_ZaQuote from: Tan_Za on September 28, 2010, 01:53:24 AM
The information that you gave me was good but it was more based around making forms alpha blend not images or objects


No it wasn't. Both links discuss Alpha-blendable Images, not forms. Although some of the responses on the stackoverflow thread are incorrect and offer such assistance re: forms.


Discussion

No Comment Found