A:
A:
A:
ScreenX = (((PassedInX + XTranslate) * ScaleMult) / ScaleDiv);
A:
A:
void myCanvas::Redraw(int x, int y, int h, int w) { static int first = 1; // Redraw is called when the canvas is first displayed, // before your code can do any real work. The vDC is // available at this point. Any special initialization // needs to be done here because the vDC is not // available at constructor time. if (first) { first = 0; // Set colors, whatever now... // And call your parent class's Redraw vParentPane::Redraw(x,y,h,w); return; } // Normal Redraw code goes here .... }
A:
//===================>>> myCanvasPane::Redraw <<<================= void myCanvasPane::Redraw(int x, int y, int w, int h) { // Cheap way to handle multiple calls to Redraw that // doesn't use the passed coordinates. static int nest = 0; // Track multiple calls to Redraw if (++nest > 1) // ignore multiple calls return; DrawImage(); // draw image - may take a while if (nest > 1) // had nested calls, so need to redraw again { DrawImage(); // draw image } nest = 0; // Really done }