void SetupRenderSurfaceAndDrawBoard() { GdiPlusRenderSurface gdiRenderSurface = new GdiPlusRenderSurface(ViewportWidth, ViewportHeight); _drawBoard = new GdiPlusDrawBoard(gdiRenderSurface); _drawBoard.CurrentFont = new RequestFont("Tahoma", 10); }
static void UpdateInvalidArea(GdiPlusDrawBoard d, IRenderElement rootElement) { int enter_canvasX = d.OriginX; int enter_canvasY = d.OriginY; d.SetCanvasOrigin(enter_canvasX - d.Left, enter_canvasY - d.Top); UpdateArea u = GetFreeUpdateArea(); u.CurrentRect = d.InvalidateArea; if (u.Width > 0 && u.Height > 0) { rootElement.Render(d, u); #if DEBUG rootElement.dbugShowRenderPart(d, u); #endif } else { } d.IsContentReady = true; d.SetCanvasOrigin(enter_canvasX, enter_canvasY);//restore ReleaseUpdateArea(u); }
public void Dispose() { if (_drawBoard != null) { _drawBoard.Dispose(); _drawBoard = null; } }
public void PaintMe(GdiPlusDrawBoard mycanvas) { if (this.IsClosed) { return; } //------------------------------------ this.rootGraphics.PrepareRender(); //--------------- this.rootGraphics.IsInRenderPhase = true; #if DEBUG this.rootGraphics.dbug_rootDrawingMsg.Clear(); this.rootGraphics.dbug_drawLevel = 0; #endif mycanvas.OffsetCanvasOrigin(-mycanvas.Left, -mycanvas.Top); Rectangle rect = mycanvas.Rect; this.rootGraphics.TopWindowRenderBox.DrawToThisCanvas(mycanvas, rect); #if DEBUG this.rootGraphics.TopWindowRenderBox.dbugShowRenderPart(mycanvas, rect); #endif mycanvas.IsContentReady = true; mycanvas.OffsetCanvasOrigin(mycanvas.Left, mycanvas.Top); //if (this.FullMode) //{ // quadPages.RenderToOutputWindowFullMode(rootGraphics.TopWindowRenderBox, hdc, // this.ViewportX, this.ViewportY, this.ViewportWidth, this.ViewportHeight); //} //else //{ // //temp to full mode // //quadPages.RenderToOutputWindowFullMode(rootGraphics.TopWindowRenderBox, hdc, this.ViewportX, this.ViewportY, this.ViewportWidth, this.ViewportHeight); // quadPages.RenderToOutputWindowPartialMode(rootGraphics.TopWindowRenderBox, hdc, // this.ViewportX, this.ViewportY, this.ViewportWidth, this.ViewportHeight); //} this.rootGraphics.IsInRenderPhase = false; #if DEBUG RootGraphic visualroot = RootGraphic.dbugCurrentGlobalVRoot; if (visualroot.dbug_RecordDrawingChain) { List <dbugLayoutMsg> outputMsgs = dbugOutputWindow.dbug_rootDocDebugMsgs; outputMsgs.Clear(); outputMsgs.Add(new dbugLayoutMsg(null as RenderElement, "[" + debug_render_to_output_count + "]")); visualroot.dbug_DumpRootDrawingMsg(outputMsgs); dbugOutputWindow.dbug_InvokeVisualRootDrawMsg(); debug_render_to_output_count++; } if (dbugHelper01.dbugVE_HighlightMe != null) { dbugOutputWindow.dbug_HighlightMeNow(dbugHelper01.dbugVE_HighlightMe.dbugGetGlobalRect()); } #endif }
static void UpdateAllArea(GdiPlusDrawBoard mycanvas, IRenderElement topWindowRenderBox) { mycanvas.OffsetCanvasOrigin(-mycanvas.Left, -mycanvas.Top); Rectangle rect = mycanvas.Rect; topWindowRenderBox.DrawToThisCanvas(mycanvas, rect); #if DEBUG topWindowRenderBox.dbugShowRenderPart(mycanvas, rect); #endif mycanvas.IsContentReady = true; mycanvas.OffsetCanvasOrigin(mycanvas.Left, mycanvas.Top); }
static void UpdateInvalidArea(GdiPlusDrawBoard mycanvas, IRenderElement rootElement) { mycanvas.OffsetCanvasOrigin(-mycanvas.Left, -mycanvas.Top); Rectangle rect = mycanvas.InvalidateArea; if (rect.Width > 0 && rect.Height > 0) { rootElement.DrawToThisCanvas(mycanvas, rect); #if DEBUG rootElement.dbugShowRenderPart(mycanvas, rect); #endif } else { } mycanvas.IsContentReady = true; mycanvas.OffsetCanvasOrigin(mycanvas.Left, mycanvas.Top); }
//------- static void UpdateAllArea(GdiPlusDrawBoard d, IRenderElement topWindowRenderBox) { int enter_canvasX = d.OriginX; int enter_canvasY = d.OriginY; d.SetCanvasOrigin(enter_canvasX - d.Left, enter_canvasY - d.Top); UpdateArea u = GetFreeUpdateArea(); u.CurrentRect = d.Rect; topWindowRenderBox.Render(d, u); #if DEBUG topWindowRenderBox.dbugShowRenderPart(d, u); #endif d.IsContentReady = true; d.SetCanvasOrigin(enter_canvasX, enter_canvasY);//restore ReleaseUpdateArea(u); }
public void ResizeAllPages(int newWidth, int newHeight) { //physicalCanvasCollection.Dispose(); //physicalCanvasCollection.ResizeAllPages(newWidth, newHeight); //if (_pageA != null) //{ // _pageA.IsUnused = true; // _pageA = null; //} if (_drawBoard != null) { if (_drawBoard.Height < newHeight || _drawBoard.Width < newWidth) { _drawBoard.Dispose(); _drawBoard = null; } else { return; } } // SetupRenderSurfaceAndDrawBoard(); }
void SetupRenderSurfaceAndDrawBoard() { GdiPlusRenderSurface gdiRenderSurface = new GdiPlusRenderSurface(ViewportWidth, ViewportHeight); _drawBoard = new GdiPlusDrawBoard(gdiRenderSurface); }