Sign in to follow this  

why 2D image edge not smooth ?

This topic is 4104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites

This topic is 4104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this