ReadLoadResolutions example for Delphi
This example shows how to use the methods and properties for FlashPix files.
var
InfoStr: String; { For composing message strings }
i: Integer; { Loop counter }
begin
{ Initialize the display }
Lead1.AutoScroll := False;
Lead1.AutoSetRects := True;
Lead1.PaintSizeMode := smFit;
Lead1.GetFileInfo('v:\images\image5.fpx', 0);
{ Update information about the available resolutions. }
Lead1.ReadLoadResolutions('v:\images\image5.fpx');
{ Display a message box that shows the available sizes. }
InfoStr := 'Available dimensions:' + CHR(13);
for i := 0 to Lead1.LoadResolutionCount - 1 do
begin
InfoStr := InfoStr + IntToStr(Lead1.LoadResolutionWidth[i]) + ' x ' + IntToStr(Lead1.LoadResolutionHeight[i]) + CHR(13);
end;
Application.MessageBox(PChar(InfoStr), 'File Information', mb_OK);
{ Set the size to load, the smallest size in this case. }
Lead1.SetLoadResolution(Lead1.InfoFormat, Lead1.LoadResolutionWidth[Lead1.LoadResolutionCount - 1], Lead1.LoadResolutionHeight[Lead1.LoadResolutionCount - 1]);
{ Get the dimensions that we just set and display them. }
Lead1.GetLoadResolution(Lead1.InfoFormat);
InfoStr := 'Size that will be loaded:' + CHR(13) + CHR(13) + IntToStr(Lead1.LoadResolutionWidth[0]) + ' x ' + IntToStr(Lead1.LoadResolutionHeight[0]) + CHR(13);
Application.MessageBox(PChar(InfoStr), 'File Information', mb_OK);
{ Load the bitmap, keeping the bits per pixel of the file. }
Lead1.Load('v:\images\image5.fpx', 0, 0, 1);
end;