 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
viana Guest
|
Posted: Wed Jun 09, 2004 7:59 pm Post subject: ImageList |
|
|
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
|
Posted: Tue Aug 03, 2004 1:33 am Post subject: Re: ImageList |
|
|
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 |
|
 |
|
|
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
|
|