Jump to content
  • Advertisement
Sign in to follow this  
nicknamenick123

why 2D image edge not smooth ?

This topic is 4391 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
Advertisement
Do not cross post. As this really isn't a game programming nor a GL/DX question, its getting moved to GP.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!