 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
José Guest
|
Posted: Sun Feb 18, 2007 9:10 am Post subject: Overlapping two pictures |
|
|
I can display images with TImage->Picture->LoadFromFile(). However, I
have some pictures which are partly transparent, and I want to display
them on top of each other. Can this be done?
--
José |
|
| Back to top |
|
 |
Clayton Arends Guest
|
Posted: Mon Feb 19, 2007 9:10 am Post subject: Re: Overlapping two pictures |
|
|
Yes. Image controls are non-windowed and so use their parent's canvas when
drawing. You need to set the parent of each image to the same parent (the
form, a panel, etc). If your pictures are BMPs then you will need to set
the 'Transparent' property of the image to true. Other file types (like GIF
and PNG) handle their own transparency.
- Clayton |
|
| Back to top |
|
 |
José Guest
|
Posted: Mon Feb 19, 2007 9:05 pm Post subject: Re: Overlapping two pictures |
|
|
On Sun, 18 Feb 2007 19:52:55 -0800, "Clayton Arends"
<nospam_claytonarends (AT) hotmail (DOT) com> wrote in
borland.public.cppbuilder.graphics:
| Quote: | I can display images with TImage->Picture->LoadFromFile(). However, I
have some pictures which are partly transparent, and I want to display
them on top of each other. Can this be done?
Yes. Image controls are non-windowed and so use their parent's canvas when
drawing. You need to set the parent of each image to the same parent (the
form, a panel, etc). If your pictures are BMPs then you will need to set
the 'Transparent' property of the image to true. Other file types (like GIF
and PNG) handle their own transparency.
|
Sorry, that doesn't work.
My pictures come as PNG, but LoadFromFile will not read that format.
GIF isn't accepted either.
I can convert the pictures to BMP or JPG, but this destroys the
transparency. Even if I set the Transparent property to true, I need a
way to tell what part of the picture should be transparent.
--
José |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Feb 21, 2007 12:31 am Post subject: Re: Overlapping two pictures |
|
|
"José" <jose (AT) 127 (DOT) 0.0.1> wrote in message
news:4uejt2tp0h227i6pbp1rnc4nqj1c88ouc9 (AT) 4ax (DOT) com...
| Quote: | My pictures come as PNG, but LoadFromFile will not read
that format. GIF isn't accepted either.
|
LoadFromFile() will accept those formats if you have
TGraphic-descendant classes registered for them. There are several
third-party implementations available for that, such as:
PNG Delphi
http://pngdelphi.sourceforge.net
TGIFImage
http://www.torry.net/vcl/graphics/gif/gifimage.exe
Gambit |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|