why 2D image edge not smooth ?

Started by
0 comments, last by Washu 17 years, 7 months ago
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);
Advertisement
Do not cross post. As this really isn't a game programming nor a GL/DX question, its getting moved to GP.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement