Beispiel #1
0
        public void ComputeTransLastHitGeometry()
        {
            switch (scMgr.GraphicsType)
            {
            case GraphicsType.GDIPLUS:

                if (hitGraphicsPath == null)
                {
                    return;
                }

                transLastHitGraphicsPath = (GraphicsPath)hitGraphicsPath.Clone();
                transLastHitGraphicsPath.Transform(globalMatrix);
                break;

            case GraphicsType.D2D:

                if (hitPathGeometry == null)
                {
                    return;
                }

                SharpDX.Direct2D1.Factory d2dFactory = D2DGraphics.d2dFactory;
                RawMatrix3x2 m32 = GDIDataD2DUtils.TransMatrixToRawMatrix3x2(globalMatrix);
                transLastHitPathGeometry = new TransformedGeometry(d2dFactory, hitPathGeometry, m32);
                break;
            }
        }
Beispiel #2
0
 public override void TranslateTransform(float dx, float dy)
 {
     System.Drawing.Drawing2D.Matrix m = GDIDataD2DUtils.TransRawMatrix3x2ToMatrix(renderTarget.Transform);
     m.Translate(dx, dy);
     renderTarget.Transform = GDIDataD2DUtils.TransMatrixToRawMatrix3x2(m);
 }