/// <summary> /// Draw the view to the specified point of the given surface. /// </summary> public void draw(Surface target, Point pt) { try { updateScreen(); } catch (COMException e) { if (DirectDraw.isSurfaceLostException(e)) { PictureManager.onSurfaceLost(this, null); updateScreen(); // and retry } else { throw e; // unable to handle this exception } } // just send the offscreen buffer to the primary surface // drawContext will be null if the client size is empty or the window is minimized. // no blitting necessary in that case. if (drawContext != null) { target.blt(pt, drawContext.surface); } }