Exemplo n.º 1
0
        void GDIPaint(ScGraphics g, ScDrawNode node)
        {
            if (node == null)
            {
                return;
            }

            ScLayer layer = node.layer;

            if (node.rootLayer == null)
            {
                g.SetClip(node.clipRect);
                g.Transform = layer.GlobalMatrix;
                g.layer     = layer;
                layer.OnGDIPaint(g);
            }
            else
            {
                ScLayer rootLayer = node.rootLayer;

                Matrix m = new Matrix();
                m.Translate(-rootLayer.DrawBox.X, -rootLayer.DrawBox.Y);
                m.Multiply(layer.GlobalMatrix);

                g.SetClip(node.clipRect);
                g.Transform = m;
                g.layer     = layer;
                layer.OnGDIPaint(g);
                m.Dispose();
            }

            g.layer = null;
            g.ResetTransform();
            g.ResetClip();
        }
Exemplo n.º 2
0
        public void Draw(ScGraphics g)
        {
            if (root == null)
            {
                return;
            }

            g.SetClip(root.clipRect);

            switch (g.GetGraphicsType())
            {
            case GraphicsType.D2D:

                if (root.isRender)
                {
                    D2DPaint(g, root);
                }

                DrawChildNodeD2D(root, g);
                break;

            case GraphicsType.GDIPLUS:
                RunGDIPaint(g);
                break;
            }

            g.ResetClip();
        }
Exemplo n.º 3
0
        void D2DPaint(ScGraphics g, ScDrawNode node)
        {
            ScLayer layer = node.layer;

            g.SetClip(node.clipRect);
            g.Transform = layer.GlobalMatrix;
            g.layer     = layer;
            layer.OnD2DPaint(g);
            g.layer = null;
            g.ResetTransform();
            g.ResetClip();
        }