PCDRes example for Delphi
This example checks for a high resolution image and loads it if possible.
procedure TForm1.Button3Click(Sender: TObject);
var
myfile, msg: String;
begin
myfile := 'v:\images\img0024.pcd'; {No PCD sample image is included with LEADTOOLS}
Lead1.GetFileInfo(myfile, 0);
If Lead1.InfoPCDRes[L_PCD_4BASE] = True Then
begin
Lead1.PCDRes := L_PCD_4BASE;
msg := 'Loading 1024 x 1536 resolution';
end
Else
begin
Lead1.PCDRes := L_PCD_BASE;
msg := 'Loading 512 x 768 resolution';
End;
ShowMessage(msg);
Screen.Cursor := crHourglass;
{Turn on the automatic display rectangles and the scroll bars.}
Lead1.AutoSetRects := True;
Lead1.AutoScroll := True;
{Load the file.}
Lead1.Load(myfile, 0, 0, 1);
Lead1.ForceRepaint;
Screen.Cursor := crDefault;
end;