DrawShape example for Delphi

This example demonstrates most of the three-dimensional shape properties as it draws a rectangle on the current bitmap. For example purposes, both inner and outer bands are turned on. However, normal three-dimensional effects use inner bands or outer bands, but not both.

var
   RasterIO: LEADRasterIO;
   RasterFxd: LEADRasterFXD;
   RasterProc: LEADRasterProcess;
begin
   RasterIO:= CreateComObject (CLASS_LEADRasterIO) as LEADRasterIO;
   RasterFxd:= CreateComObject (CLASS_LEADRasterFXD) as LEADRasterFXD;
   RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;

   LEADRasterView1.AutoRepaint := False;
   //Load an image for the main control
   RasterIO.Load (LEADRasterView1.Raster, 'v:\images\image1.cmp', 0, 0, 1);
   //Load an image for the background of the shape
   RasterIO.Load (LEADRasterView2.Raster, 'c:\temp\ulay1.bmp', 0, 0, 1);
   //Shape background
   RasterFxd.ShapeBackgroundStyle := FXD_BACKSTYLE_TILED_IMAGE;
   RasterFxd.BackgroundImageTop := 0;
   RasterFxd.BackgroundImageLeft := 0;
   RasterFxd.BackgroundImageWidth := LEADRasterView2.Raster.BitmapWidth;
   RasterFxd.BackgroundImageHeight := LEADRasterView2.Raster.BitmapHeight;
   //Shape location
   RasterFxd.ShapeTop := 50;
   RasterFxd.ShapeLeft := 50;
   RasterFxd.ShapeWidth := LEADRasterView1.DstWidth - 50;
   RasterFxd.ShapeHeight := LEADRasterView1.DstHeight - 50;
   //Shape border
   RasterFxd.ShapeBorderColor := RGB(255, 0, 0);
   RasterFxd.ShapeBorderStyle := FXD_BORDERSTYLE_SOLID;
   RasterFxd.ShapeBorderThickness := 10;
   RasterFxd.ShapeInnerBandHiliteColor := RGB(255, 255, 255);
   RasterFxd.ShapeInnerBandShadowColor := 0;
   RasterFxd.ShapeInnerBandStyle := FXD_INNERSTYLE_RAISED;
   RasterFxd.ShapeInnerBandThickness := 2;
   RasterFxd.ShapeOuterBandHiliteColor := RGB(0, 255, 0);
   RasterFxd.ShapeOuterBandShadowColor := RGB(128, 128, 128);
   RasterFxd.ShapeOuterBandStyle := FXD_OUTERSTYLE_RAISED;
   RasterFxd.ShapeOuterBandThickness:= 2;
   //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, LEADRasterView2.Raster.Bitmap);
   //Repaint
   LEADRasterView1.AutoRepaint := True;
end;