예제 #1
0
        public override void Render(Graphics g)
        {
            var region = Region;

            g.DrawEllipse(StrokePen, region.X, region.Y, region.Width, region.Height);
            g.FillEllipse(FillBrush, region.X + StrokeThickness.Int32(), region.Y + StrokeThickness.Int32(), region.Width - (StrokeThickness.Int32() * 2), region.Height - (StrokeThickness.Int32() * 2));
        }
예제 #2
0
        public override void Render(WriteableBitmap input)
        {
            var x1 = Region.X;
            var y1 = Region.Y;

            var x2 = Region.X + Region.Width;
            var y2 = Region.Y + Region.Height;

            input.FillRectangle(x1, y1, x2, y2, Stroke.Color);

            x1 += StrokeThickness.Int32();
            y1 += StrokeThickness.Int32();
            x2 -= StrokeThickness.Int32();
            y2 -= StrokeThickness.Int32();

            x2 = x2 <= x1 ? x1 + 1 : x2;
            y2 = y2 <= y1 ? y1 + 1 : y2;

            input.FillRectangle(x1, y1, x2, y2, Fill.Color);
        }
예제 #3
0
        public override void Render(WriteableBitmap input)
        {
            var x1 = Region.X;
            var y1 = Region.Y;

            var x2 = Region.X + Region.Width;
            var y2 = Region.Y + Region.Height;

            if (Style.ColorOverlay.IsEnabled)
            {
                input.FillEllipse(x1, y1, x2, y2, Style.ColorOverlay.Color, null);
                return;
            }

            input.FillEllipse(x1, y1, x2, y2, Stroke.Color, null);

            x1 += StrokeThickness.Int32();
            y1 += StrokeThickness.Int32();
            x2 -= StrokeThickness.Int32();
            y2 -= StrokeThickness.Int32();

            x2 = x2 <= x1 ? x1 + 1 : x2;
            y2 = y2 <= y1 ? y1 + 1 : y2;

            input.FillEllipse(x1, y1, x2, y2, Fill.Color, null);

            if (Transform is ScaleTransform)
            {
            }
            if (Transform is SkewTransform)
            {
                if ((Transform as SkewTransform).TopLeft != null)
                {
                    Preview = TransformTool.Shear(input.Bitmap(), (Transform as SkewTransform).TopLeft.X, (Transform as SkewTransform).TopLeft.Y).WriteableBitmap();
                }
            }
        }