GDI+ 平铺图像

CDC *pDC = GetDC();
Gdiplus::Graphics graphics(pDC->m_hDC);
Gdiplus::Image SImage(L"F:\\bg.png");

Gdiplus::TextureBrush textureBrush(&SImage, 
    Gdiplus::WrapModeTile);

CRect rectWindow;
GetWindowRect(rectWindow);
graphics.FillRectangle(&textureBrush, 
    Gdiplus::RectF(0,
                 0, 
                 (Gdiplus::REAL)rectWindow.Width(),
                 Gdiplus::REAL)rectWindow.Height()
    )
);

猜你喜欢

转载自blog.csdn.net/tg2003/article/details/45422635