type
TMainForm = class(TForm)
...
private
FImg : TSingleImage;
{$IFDEF USE_GR32}
Image32 : TImage32;
{$ENDIF}
procedure LoadFile(AFileName:string);
...
end;
procedure TMainForm.LoadFile(AFileName:string);
var
T : int64;
imgbitmap : TImagingBitmap;
success : boolean;
begin
success := false;
T := ImagingUtility.GetTimeMicroseconds;
FreeAndNil(FImg);
Screen.Cursor := crHourglass;
try
FImg := TSingleImage.CreateFromFile(AFileName);
if FImg <> nil then begin
imgbitmap := TImagingBitmap.Create;
try
imgbitmap.Assign(FImg);
{$IFDEF USE_GR32}
Image32.Bitmap.Assign(imgbitmap);
{$ELSE}
Image.Picture.Assign(imgbitmap);
{$ENDIF}
success := true;
finally
imgbitmap.Free;
end;
end;
...
finally
Screen.Cursor := crDefault;
end;
end;
Page created in 0.011 seconds with 19 queries.