why 2D image edge not smooth ?
hello,
I use code like the following, this code xor a bitmap and a mask bitmap, and display a simple image on a dialog window, but the outcome image edge cannot be soomth always. Any good method for me? Many many thanks.
cBitmap.LoadBitmap(IDB_MASK);
memDC.CreateCompatibleDC(pDC);
pOldMemBmp = memDC.SelectObject(&cBitmap);
//create irregular region
wndRgn.CreateRectRgn(0, 0, cRect.Width(), cRect.Height());
for(x=0; x<=cRect.Width(); x++)
{
for(y=0; y<=cRect.Height(); y++)
{
col = memDC.GetPixel(x, y);
if(col == 0)
{
rgnTemp.CreateRectRgn(x, y, x+1, y+1);
wndRgn.CombineRgn(&wndRgn, &rgnTemp, RGN_XOR);
rgnTemp.DeleteObject();
}
}
}
if (pOldMemBmp) memDC.SelectObject(pOldMemBmp);
SetWindowRgn((HRGN)wndRgn, TRUE);
ReleaseDC(pDC);
Do not cross post. As this really isn't a game programming nor a GL/DX question, its getting moved to GP.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement