BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overlapping two pictures

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
José
Guest





PostPosted: Sun Feb 18, 2007 9:10 am    Post subject: Overlapping two pictures Reply with 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?
--
José
Back to top
Clayton Arends
Guest





PostPosted: Mon Feb 19, 2007 9:10 am    Post subject: Re: Overlapping two pictures Reply with quote



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





PostPosted: Mon Feb 19, 2007 9:05 pm    Post subject: Re: Overlapping two pictures Reply with quote



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





PostPosted: Wed Feb 21, 2007 12:31 am    Post subject: Re: Overlapping two pictures Reply with quote

"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.