'TBitBtn'에 해당되는 글 1건

  1. 2007/09/11 Show *any* graphics as Glyph on a SpeedButton
2007/09/11 07:59

Show *any* graphics as Glyph on a SpeedButton

TBitBtn and TSpeedButton accept only BMP pictures, if you have some other picture format, like ICO or JPG, (in an Image component) you want to show as a Glyph, you'll need to "transform" it to Bitmap, here's how:

var
   bmp:TBitmap;
begin
   bmp:=TBitmap.Create;
   try
     bmp.Width := Image.Picture.Graphic.Width;
     bmp.Height := Image.Picture.Graphic.Height;
     bmp.Canvas.Draw(0, 0, Image.Picture.Graphic) ;
     BitBtn.Glyph:=bmp;
   finally
     bmp.Free;
   end;
end;
Trackback 0 Comment 0