GDI +圆角图像c ++

时间:2017-06-08 10:26:51

标签: c++ graphics mfc gdi

我使用GDI +使用此类在CStatic *element上绘制图像: https://www.codeproject.com/Articles/24969/An-MFC-picture-control-to-dynamically-show-picture

这是我的代码onDraw

void CPictureCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if (mBIsPicLoaded)  {
    RECT rc;
    this->GetClientRect(&rc);

    Graphics graphics(lpDrawItemStruct->hDC);
    Image image(mPstream);
    graphics.DrawImage(&image, (INT)rc.left, (INT)rc.top, (INT)(rc.right - rc.left), (INT)(rc.bottom - rc.top));
}
}

图像显示为矩形。但我想说清楚。 怎么做 ? 感谢

0 个答案:

没有答案