Trim example for C++ 5.0 and later
This example trims one-tenth from the bitmap and repaints the image.
float NewLeft = m_LEADRasterView1.GetRaster().GetBitmapWidth() * .1f;
float NewTop = m_LEADRasterView1.GetRaster().GetBitmapHeight() * .1f;
float NewWidth = m_LEADRasterView1.GetRaster().GetBitmapWidth() * .8f;
float NewHeight = m_LEADRasterView1.GetRaster().GetBitmapHeight() * .8f;
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Trim(m_LEADRasterView1.GetRaster(),
NewLeft, NewTop, NewWidth, NewHeight);
// Set the image display size to match the LEAD control
m_LEADRasterView1.SetDstRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.SetDstClipRect(0.0f, 0.0f,
m_LEADRasterView1.GetScaleWidth(),
m_LEADRasterView1.GetScaleHeight());
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();