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 

Determine Graphic Type witin TImage

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





PostPosted: Sun Nov 21, 2004 10:28 pm    Post subject: Determine Graphic Type witin TImage Reply with quote



I'm using a TImage to allow users to copy/paste graphics from the clipboard.

I need to be able to save these graphics to file but I can't seem to
determine their graphic type so that I can put the correct extension on the
files.

Can anyone help me determine the graphic type within a TImage component?


Back to top
Eudy Silva
Guest





PostPosted: Mon Nov 29, 2004 2:01 am    Post subject: Re: Determine Graphic Type witin TImage Reply with quote



I would do something like this:

AnsiString PictType = Image1->Picture->Graphic->ClassName();

if (PictType == "TBitmap")
Image1->Picture->SaveToFile("test.bmp");
else if (PictType == "TIcon")
Image1->Picture->SaveToFile("test.ico");
else if (PictType == "TMetafile") {
if (Image1->Picture->Metafile->Enhanced == true)
Image1->Picture->SaveToFile("test.emf");
else
Image1->Picture->SaveToFile("test.wmf");
}

Eudy

Daniel Stevenson wrote:
Quote:
I'm using a TImage to allow users to copy/paste graphics from the clipboard.

I need to be able to save these graphics to file but I can't seem to
determine their graphic type so that I can put the correct extension on the
files.

Can anyone help me determine the graphic type within a TImage component?




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.