Beispiel #1
0
 DrawingPath GetPath()
 {
     //create path
     DrawingPath path = new DrawingPath();
     path.MoveTo(200, 100);
     path.CurveTo(200, 350, 340, 30, 360, 200);
     path.CurveTo(200, 100, 40, 200, 60, 30);
     return path;
 }
        private void btnDrawPath_Click(object sender, EventArgs e)
        {
            //create a new drawing context
            PixelsBuffer buffer = new PixelsBuffer(400, 400);
            IDrawer drawer = new Drawer(buffer);
            drawer.Clear(Colors.White);

            //create fill for drawing
            Fill fill = Fills.MistyRose;

            //create path
            DrawingPath path = new DrawingPath();
            path.MoveTo(200, 100);
            path.CurveTo(200, 350, 340, 30, 360, 200);
            path.CurveTo(200, 100, 40, 200, 60, 30);

            //draw content
            drawer.Rotate(15);
            drawer.Scale(0.3, 0.3);
            drawer.DrawPath(fill, path);

            //show to screen
            DisplayBuffer(buffer);
        }