Trim example for C++ Builder

This example trims one-tenth from the bitmap and repaints the image.

int NewLeft, NewTop, NewWidth, NewHeight;

NewLeft  = Lead1->BitmapWidth / 10;
NewTop  = Lead1->BitmapHeight / 10;
NewWidth  = (Lead1->BitmapWidth * 8) / 10;
NewHeight  = (Lead1->BitmapHeight * 8) / 10;
Lead1->Trim(NewLeft, NewTop, NewWidth, NewHeight);

// Set the image display size to match the LEAD control
Lead1->SetDstRect(0, 0, Lead1->BitmapWidth, Lead1->BitmapHeight);
Lead1->SetDstClipRect(0, 0, Lead1->BitmapWidth, Lead1->BitmapHeight);
Lead1->ForceRepaint();