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 

ImageList

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
viana
Guest





PostPosted: Wed Jun 09, 2004 7:59 pm    Post subject: ImageList Reply with quote




hi,

i'm trying to use a BMP from a TImagelist to put it in the glyph property of a button. the code is like this :

imagelist1.getbitmap(1,button1.glyph);

the code works, but the image in the button never is exact the same as the image in the imagelist. there is some differences in color.

so the question is : how to get a bitmap in the imagelist and it looks exact as in the imagelist ?

thanks in advance
Back to top
Ma Xiaoguang
Guest





PostPosted: Tue Aug 03, 2004 1:33 am    Post subject: Re: ImageList Reply with quote



Hi, viana:

I think you should to use a TSpeedButton instead of TButton. I loaded
the bitmap from TImageList was successful. My codes like this:

procedure TForm1.Button1Click(Sender: TObject);
var
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
try
ImageList1.GetBitmap(0, Bmp);
{ Maybe you need the following line. The transparent color
should be same as the Icon in TImageList. }
Bmp.TransprarentColor := clWhite;
SpeedButton1.Glyph.Assign(Bmp);
finally
Bmp.Free;
end;
end;

The codes above was worked with Delphi 5.

Best regards.

Xiaoguang

"viana" <danield77@g.com.br> wrote

Quote:

hi,

i'm trying to use a BMP from a TImagelist to put it in the glyph property
of a button. the code is like this :

imagelist1.getbitmap(1,button1.glyph);

the code works, but the image in the button never is exact the same as the
image in the imagelist. there is some differences in color.

so the question is : how to get a bitmap in the imagelist and it looks
exact as in the imagelist ?

thanks in advance



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi 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.