Example #1
0
bool CImageSelect::SetImageRectSelection(CRect *rect)
{
    CxImage* ima = ℑ

    if (ima==0)
        return false;

    long x,y;
    RECT rect_img;
    x = rect_img.left = rect->left-(500-(int)(image.GetWidth()*ZoomFactor))/2;
    y = rect_img.top = rect->top-(300-(int)(image.GetHeight()*ZoomFactor))/2;
    GetImageXY(ima, &x,&y);
    rect_img.top =  y;
    rect_img.left = x;

    x = rect_img.right = rect->right-(500-(int)(image.GetWidth()*ZoomFactor))/2;
    y = rect_img.bottom = rect->bottom-(300-(int)(image.GetHeight()*ZoomFactor))/2;
    GetImageXY(ima, &x,&y);
    rect_img.bottom = y;
    rect_img.right = x;

    ima->SelectionClear();
    ima->SelectionAddRect(rect_img);
    ima->Crop(rect_img,&NewImage);
    return true;
}