Exemple #1
0
        void SetupRenderSurfaceAndDrawBoard()
        {
            GdiPlusRenderSurface gdiRenderSurface = new GdiPlusRenderSurface(ViewportWidth, ViewportHeight);

            _drawBoard             = new GdiPlusDrawBoard(gdiRenderSurface);
            _drawBoard.CurrentFont = new RequestFont("Tahoma", 10);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public void Dispose()
 {
     if (_drawBoard != null)
     {
         _drawBoard.Dispose();
         _drawBoard = null;
     }
 }
Exemple #4
0
        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
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        //-------
        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);
        }
Exemple #8
0
 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();
 }
Exemple #9
0
        void SetupRenderSurfaceAndDrawBoard()
        {
            GdiPlusRenderSurface gdiRenderSurface = new GdiPlusRenderSurface(ViewportWidth, ViewportHeight);

            _drawBoard = new GdiPlusDrawBoard(gdiRenderSurface);
        }