Trim example for C++ Builder
This example trims one-tenth from the bitmap and repaints the image.
float NewLeft, NewTop, NewWidth, NewHeight, ViewWidth, ViewHeight;
LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
NewLeft= LEADRasterView1->Raster->BitmapWidth * 0.1;
NewTop= LEADRasterView1->Raster->BitmapHeight * 0.1;
NewWidth = LEADRasterView1->Raster->BitmapWidth * 0.8;
NewHeight= LEADRasterView1->Raster->BitmapHeight * 0.8;
pRasterProc->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 ();
pRasterProc-> Release( );