Jump to content
  • Advertisement
Sign in to follow this  

paint prog - resized window to act like full screen

This topic is 4323 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

I'm trying to write some code so that I can paint into a resized window with something like an airbrush in such a way that it will act exactly as though it were painting into the full screen version of the backbuffer. In other words, I don't want to resize the backbuffer at all. I need to extract the previous (full screen) pixel colors under a given area (like inside the airbrush circle for example), but I need to be able to do this as though it were in full screen mode. Then I need to apply the effect to those pixels and resubmit as thought I were in full screen mode. I thought perhaps the backbuffer remains in tact when I resize, maybe just some kind of mouse coordinate or pixel coordinate conversions?? Has anyone ever done this? Any ideas?

Share this post

Link to post
Share on other sites
Just an update. I added this function:

// C O N V E R T T O F U L L S C R E E N C O O R D I N A T E
void ConvertToFullScreenCoordinate(LONG &x, LONG &y) {
LONG width,height;
float w,h;
RECT rect;
GetWindowRect(g_hwnd, &rect);
x=(LONG)(w*(float)x); y=(LONG)(h*(float)y);

It seems to work ok for a single pixel so far...
I'm still not so sure if this is the best way to handle this. Any ideas or feedback are more than welcome.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!