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 

Save the extracted icons

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





PostPosted: Fri Jun 16, 2006 5:45 pm    Post subject: Save the extracted icons Reply with quote



Hello,

I created a Form with two Image and a button. In one of the image I
have choose the image (an icon) from the image properties and for the
button I have written this code:


void __fastcall TForm1::Button1Click(TObject *Sender)
{
TIcon *iconx=new TIcon;
iconx->Handle=ExtractIconA(NULL,Application->ExeName.c_str(),0);
Image2->Picture->Icon=iconx;
Image1->Picture->Icon->SaveToFile("C:\\test\\BCB tests\\icon1.ico");
Image2->Picture->Icon->SaveToFile("C:\\test\\BCB tests\\icon2.ico");
delete iconx;
}


Now when I press Button1 the first icon (the icon that belongs to the
Image1) is saved correctly. But the second icon (the icon that belongs
to Image2) is saved in 16 colors although the icon is in 256 colors.
The extracted icon that is inserted into Image 2 is correctly displayed

in Image2 but it is not saved correctly.

Can someone please tell (if possible not trough links) me why does this

happens and what I have to do to save the extracted icons correctly?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (WinAPI) 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.