Esempio n. 1
0
 void Test2()
 {
     canvas2d.ClearColorBuffer();
     canvas2d.SmoothMode  = CanvasSmoothMode.Smooth;
     canvas2d.StrokeColor = PixelFarm.Drawing.Color.Blue;
     canvas2d.StrokeWidth = 1;
     painter.StrokeWidth  = 1;
     ////line
     painter.FillColor = PixelFarm.Drawing.Color.Green;
     painter.FillRectLBWH(100, 100, 50, 50);
     canvas2d.DrawLine(50, 50, 200, 200);
     canvas2d.DrawRect(10, 10, 50, 50);
     painter.FillRenderVx(polygon2);
     painter.StrokeColor = PixelFarm.Drawing.Color.Blue;
     painter.DrawRenderVx(polygon2);
     //-------------------------------------------
     ////polygon
     painter.DrawRenderVx(polygon1);
     canvas2d.StrokeColor = PixelFarm.Drawing.Color.Green;
     ////--------------------------------------------
     painter.DrawCircle(100, 100, 25);
     painter.DrawEllipse(200, 200, 225, 250);
     ////
     painter.FillColor = PixelFarm.Drawing.Color.OrangeRed;
     painter.FillCircle(100, 400, 25);
     canvas2d.StrokeColor = PixelFarm.Drawing.Color.OrangeRed;
     painter.DrawCircle(100, 400, 25);
     ////
     painter.FillColor = PixelFarm.Drawing.Color.OrangeRed;
     painter.FillEllipse(200, 400, 225, 450);
     canvas2d.StrokeColor = PixelFarm.Drawing.Color.OrangeRed;
     painter.DrawEllipse(200, 400, 225, 450);
     //-------------------------------------------
     SwapBuffer();
 }
        protected override void OnGLRender(object sender, EventArgs args)
        {
            GL.Clear(ClearBufferMask.ColorBufferBit);
            canvas2d.StrokeColor = PixelFarm.Drawing.Color.Blue;
            //line
            canvas2d.DrawLine(50, 50, 200, 200);
            //--------------------------------------------
            //rect
            canvas2d.DrawRect(2.5f, 1.5f, 50, 50);
            canvas2d.FillRect(PixelFarm.Drawing.Color.Green, 50, 50, 50, 50);
            //--------------------------------------------

            //circle & ellipse
            canvas2d.DrawCircle(100, 100, 25);
            canvas2d.DrawEllipse(200, 200, 25, 50);
            canvas2d.FillCircle(PixelFarm.Drawing.Color.OrangeRed, 100, 400, 25);
            canvas2d.FillEllipse(PixelFarm.Drawing.Color.OrangeRed, 200, 400, 25, 50);
            //--------------------------------------------
            //polygon
            float[] polygon1 = new float[] {
                50, 200,
                250, 200,
                125, 350
            };
            canvas2d.DrawPolygon(polygon1, 3);
            float[] polygon2 = new float[] {
                250, 400,
                450, 400,
                325, 550
            };
            canvas2d.FillPolygon(PixelFarm.Drawing.Color.Green, polygon2);
            //--------------------------------------------
            miniGLControl.SwapBuffers();
        }