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()
    )
);

你可能感兴趣的:(gdi)