paint prog - resized window to act like full screen

Started by
0 comments, last by renman29 17 years, 8 months ago
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?
Advertisement
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);		width=rect.right-rect.left;	height=rect.bottom-rect.top;	w=(float)g_width/(float)width;	h=(float)g_height/(float)height;	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.

This topic is closed to new replies.

Advertisement