//-------------------------------------------------------------- // set dimensions of surface void mgTextureSurface::setSurfaceSize( int width, int height) { mgGenSurface::setSurfaceSize(width, height); if (m_singleTile) resizeSingleImage(width, height); else resizeTiledImage(width, height); }
//-------------------------------------------------------------- // set dimensions of image void mgXPSurface::setSurfaceSize( int width, int height) { if (m_singleTile) resizeSingleImage(width, height); else resizeTiledImage(width, height); // clear the image to black RECT rect; rect.left = 0; rect.top = 0; rect.right = m_imageWidth; rect.bottom = m_imageHeight; FillRect(m_surfaceDC, &rect, (HBRUSH) GetStockObject(BLACK_BRUSH)); FillRect(m_alphaDC, &rect, (HBRUSH) GetStockObject(BLACK_BRUSH)); // set the entire image area damaged damage(0, 0, m_imageWidth, m_imageHeight); }