Пример #1
0
        protected override void OnGLRender(object sender, EventArgs args)
        {
            _pcx.SmoothMode  = SmoothMode.Smooth;
            _pcx.StrokeColor = PixelFarm.Drawing.Color.Blue;
            _pcx.ClearColorBuffer();
            _painter.FillColor = PixelFarm.Drawing.Color.Black;
            _painter.FillRect(0, 0, 150, 150);

            //-------------------------------------------------------------------------
            _painter.FillRenderVx(_textureBrush, _polygon1);
            //_painter.FillRenderVx(_linearGradient, _polygon1);
            ////-------------------------------------------------------------------------


            //fill polygon with gradient brush
            _painter.FillColor = Color.Yellow;
            _painter.FillRect(200, 0, 150, 150);
            //_painter.FillRenderVx(_textureBrush2, _polygon2);
            _painter.FillRenderVx(_linearGradient, _polygon2);


            ////-------------------------------------------------------------------------
            _painter.FillColor = Color.Black;
            _painter.FillRect(400, 0, 150, 150);
            //another  ...
            _painter.FillRenderVx(_textureBrush2, _polygon3);
            ////-------------------------------------------------------------------------


            SwapBuffers();
        }
Пример #2
0
        protected override void OnGLRender(object sender, EventArgs args)
        {
            _pcx.SmoothMode  = SmoothMode.Smooth;
            _pcx.StrokeColor = PixelFarm.Drawing.Color.Blue;
            _pcx.ClearColorBuffer();
            _painter.FillColor = PixelFarm.Drawing.Color.Black;
            _painter.FillRect(0, 0, 150, 150);
            GLBitmap glBmp        = DemoHelper.LoadTexture(RootDemoPath.Path + @"\logo-dark.jpg");
            var      textureBrush = new TextureBrush(glBmp);

            _painter.FillRenderVx(textureBrush, _polygon1);
            //-------------------------------------------------------------------------
            var linearGrBrush2 = new LinearGradientBrush(
                new PointF(0, 50), new PointF(0, 100),
                Color.Red, Color.White);

            //fill polygon with gradient brush
            _painter.FillColor = Color.Yellow;
            _painter.FillRect(200, 0, 150, 150);
            _painter.FillRenderVx(linearGrBrush2, _polygon2);
            _painter.FillColor = Color.Black;
            _painter.FillRect(400, 0, 150, 150);
            //-------------------------------------------------------------------------
            //another  ...
            _painter.FillRenderVx(linearGrBrush2, _polygon3);
            //-------------------------------------------------------------------------


            SwapBuffers();
        }
Пример #3
0
        void Test2()
        {
            _pcx.ClearColorBuffer();
            _pcx.SmoothMode      = SmoothMode.Smooth;
            _pcx.StrokeColor     = PixelFarm.Drawing.Color.Blue;
            _pcx.StrokeWidth     = 1;
            _painter.StrokeWidth = 1;
            ////line
            _painter.FillColor = PixelFarm.Drawing.Color.Green;
            _painter.FillRect(100, 100, 50, 50);
            _pcx.DrawLine(50, 50, 200, 200);

            _painter.FillRenderVx(_polygon2);
            _painter.StrokeColor = PixelFarm.Drawing.Color.Blue;
            _painter.DrawRenderVx(_polygon2);
            //-------------------------------------------
            ////polygon
            _painter.DrawRenderVx(_polygon1);
            _pcx.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);
            _pcx.StrokeColor = PixelFarm.Drawing.Color.OrangeRed;
            _painter.DrawCircle(100, 400, 25);
            ////
            _painter.FillColor = PixelFarm.Drawing.Color.OrangeRed;
            _painter.FillEllipse(200, 400, 225, 450);
            _pcx.StrokeColor = PixelFarm.Drawing.Color.OrangeRed;
            _painter.DrawEllipse(200, 400, 225, 450);
            //-------------------------------------------
            SwapBuffers();
        }
Пример #4
0
        public void RenderFrame()
        {
            _painter.Clear(Color.White);
            _painter.FillColor = Color.Yellow;
            //for (int i = 0; i < 10; ++i)
            //{
            //    _painter.FillRect(100 + i * 120, 200 + i * 120, 100, 100);
            //}

            _painter.FontFillColor = Color.Black;
            _painter.FillRect(100, 250, 20, 20);
            _painter.DrawString("Hello!", 100, 250);
            _painter.DrawString("...from Typography", 100, 300);
        }
 void HandleGLPaint(object sender, System.EventArgs e)
 {
     _glsx.SmoothMode  = SmoothMode.Smooth;
     _glsx.StrokeColor = PixelFarm.Drawing.Color.Black;
     _glsx.ClearColorBuffer();
     //example
     canvasPainter.FillColor = PixelFarm.Drawing.Color.Black;
     canvasPainter.FillRect(20, 20, 150, 150);
     //load bmp image
     //-------------------------------------------------------------------------
     if (demobase != null)
     {
         demobase.Draw(canvasPainter);
     }
     glControl.SwapBuffers();
 }