PatternStyle (ILEADRasterFXD) example for Delphi
var
RasterIO: LEADRasterIO;
RasterFxd: LEADRasterFXD;
begin
RasterIO:= CreateComObject(CLASS_LEADRasterIO)as LEADRasterIO;
RasterFxd:= CreateComObject(CLASS_LEADRasterFXD) as LEADRasterFXD;
LEADRasterView1.AutoRepaint := False;
//Load an image for the main control
RasterIO.Load (LEADRasterView1.Raster, 'v:\images\Image1.cmp', 0, 0, 1);
//Shape background
RasterFxd.ShapeBackgroundStyle := FXD_BACKSTYLE_OPAQUE;
RasterFxd.PatternStyle := FXD_PATTERN_CROSS;
RasterFxd.PatternBackColor := RGB(255, 0, 0);//red
RasterFxd.PatternForeColor := RGB(0, 0, 255); //blue
//Shape location
RasterFxd.ShapeTop := 50;
RasterFxd.ShapeLeft := 50;
RasterFxd.ShapeWidth := LEADRasterView1.DstWidth - 50;
RasterFxd.ShapeHeight := LEADRasterView1.DstHeight - 50;
//Make the shape a permanent part of the bitmap
RasterFxd.DrawPersistence := True;
RasterFxd.DstLeft := 0;
RasterFxd.DstTop := 0;
RasterFxd.DstRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.DstBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.SrcLeft := 0;
RasterFxd.SrcTop := 0;
RasterFxd.SrcRight := Trunc(LEADRasterView1.Raster.BitmapWidth);
RasterFxd.SrcBottom := Trunc(LEADRasterView1.Raster.BitmapHeight);
RasterFxd.ScaleMode := 3;
RasterFxd.ClientSizeX := 5;
RasterFxd.ClientSizeY := 5;
//Draw the shape
RasterFxd.DrawShape (LEADRasterView1.Raster, 0, FXD_SHAPE_RECTANGLE, 0);
//Repaint
LEADRasterView1.AutoRepaint := True
end;