Trim example for Visual Basic
This example trims one-tenth from the bitmap and repaints the image.
' Declare local variables
Dim NewLeft, NewTop, NewWidth, NewHeight, ViewWidth, ViewHeight
Dim RasterProc As New LEADRasterProcess
NewLeft = LEADRasterView1.Raster.BitmapWidth * 0.1
NewTop = LEADRasterView1.Raster.BitmapHeight * 0.1
NewWidth = LEADRasterView1.Raster.BitmapWidth * 0.8
NewHeight = LEADRasterView1.Raster.BitmapHeight * 0.8
RasterProc.Trim LEADRasterView1.Raster, NewLeft, NewTop, NewWidth, NewHeight
' Set variables for the position and size of the display rectangle.
ViewWidth = LEADRasterView1.ScaleWidth
ViewHeight = LEADRasterView1.ScaleHeight
' Set the image display size to match the LEAD control
LEADRasterView1.SetDstRect 0, 0, ViewWidth, ViewHeight
LEADRasterView1.SetDstClipRect 0, 0, ViewWidth, ViewHeight
LEADRasterView1.ForceRepaint