Example #1
0
        public void ResetTransform()
        {
            if (transformMatrix != null)
            {
                transformMatrix.Dispose();
            }

            if (list.Count == 1)
            {
                DesignInstance di = instanceManager[list[0]];
                transformMatrix     = di.GetMatrix().SysMatrix();
                center              = di.RotationCenter;
                untransformedBounds = di.Definition.StrokeBounds;//.TranslatedRectangle(-di.Location.X, -di.Location.Y);
            }
            else
            {
                transformMatrix = new Matrix();
                transformMatrix.Translate(StrokeBounds.Left, StrokeBounds.Top, MatrixOrder.Append);
                center = StrokeBounds.LocalCenter;
                //center = StrokeBounds.LocalCenter.Translate(StrokeBounds.Point);
                untransformedBounds = StrokeBounds.TranslatedRectangle(-StrokeBounds.Left, -StrokeBounds.Top);
            }

            isTransformDirty = false;
        }
Example #2
0
        public Bitmap GetOutline()
        {
            Bitmap bmp = null;

            if (StrokeBounds != Vex.Rectangle.Empty)
            {
                RectangleF sbt = MainForm.CurrentStage.StageToCamera(StrokeBounds.SysRectangleF());
                bmp = Gdi.GdiRenderer.GetEmptyBitmap(sbt.Size);
                Graphics g = Gdi.GdiRenderer.GetGraphicsFromBitmap(bmp);
                g.Transform = MainForm.CurrentStage.CameraMatrix;
                DrawOutlineInto(g, -sbt.Left, -sbt.Top);
                g.Dispose();
            }
            return(bmp);
        }