I have generated a form that is to show the status of certain fields by bitmaps (see attached screenshot). The TImage(s) are filled from an TImageList instance that holds images at 16x16 and 22x22 pixel resolutions. When I assign the images to the form only the 16x16 pixel resolution is depicted there. What am I doing wrong?
The function doing the assignment looks like:
procedure TForm25.ShowData(alabel: TLabel; show_label: integer; aimage: TImage; show_image: integer; image_no: integer);
var
aRect : TRect;
begin
if (show_label = 0) then
begin
alabel.Enabled := False;
aimage.Visible := False;
end
else if (show_label = 1) then
begin
alabel.Enabled := True;
ImageList1.GetBitmap(image_no, TCustomBitmap(aimage.Picture.Bitmap));
aRect := Rect(aimage.Left, aimage.Top, aimage.Left+aimage.Width, aimage.Top+aimage.Height);
aimage.Picture.Bitmap.Canvas.StretchDraw(aRect, aimage.Picture.Bitmap);
aimage.Visible := True;
end
end;