| View previous topic :: View next topic |
| Author |
Message |
Daniel Stevenson Guest
|
Posted: Sun Nov 21, 2004 10:28 pm Post subject: Determine Graphic Type witin TImage |
|
|
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
|
Posted: Mon Nov 29, 2004 2:01 am Post subject: Re: Determine Graphic Type witin TImage |
|
|
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 |
|
 |
|