KeyPress example for Delphi
This example demonstrates the KeyPress event.
procedure TForm1.LEADRasterView1KeyPress (Sender: TObject;
KeyAscii: Smallint);
if (KeyAscii = 67) then //Uppercase C
begin
//This example sets an custom scale mode and uses it to crop the
//display. Keep in mind that the actual height and width do not change.
//Only the unit of measure changes.
//Change the scale so that origin is moved one-third right and one-third down
LEADRasterView1.ScaleLeft := -1;
LEADRasterView1.ScaleTop := -1;
LEADRasterView1.ScaleWidth := 3;
LEADRasterView1.ScaleHeight := 3;
//Crop the display so that it takes up the middle third of the height and width
LEADRasterView1.DstClipLeft := 0;
LEADRasterView1.DstClipTop := 0;
LEADRasterView1.DstClipWidth := 1;
LEADRasterView1.DstClipHeight := 1;
LEADRasterView1.ForceRepaint (sRet);
end;
end;