Exemplo n.º 1
0
 public static Bitmap CreateRectangle(Device d, RectangleF rectF, Brush brush)
 {
     AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);
     if (gdi != null)
     {
         Graphics g = gdi.GetGraphics();
         if (g != null)
         {
             g.FillRectangle(brush, rectF);
             return gdi.ToBitmap();
         }
     }
     return null;
 }
Exemplo n.º 2
0
        public static Bitmap CreateRectangle(Device d, RectangleF rectF, Brush brush)
        {
            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);

            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.FillRectangle(brush, rectF);
                    return(gdi.ToBitmap());
                }
            }
            return(null);
        }
Exemplo n.º 3
0
        public static Bitmap CreateCircle(Device d, int radius, Brush brush)
        {
            int width = radius*2;
            int height = width;

            AGT_TextureResource gdi = new AGT_TextureResource(width, height);
            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.FillEllipse(brush, 0, 0, width, height);
                    return gdi.ToBitmap();
                }
            }
            return null;
        }
Exemplo n.º 4
0
        public static Bitmap CreateCircle(Device d, int radius, Brush brush)
        {
            int width  = radius * 2;
            int height = width;

            AGT_TextureResource gdi = new AGT_TextureResource(width, height);

            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.FillEllipse(brush, 0, 0, width, height);
                    return(gdi.ToBitmap());
                }
            }
            return(null);
        }
Exemplo n.º 5
0
        public static Bitmap CreateFillPolygon(Device d, GraphicsPath path, Brush brush)
        {
            RectangleF rectF = path.GetBounds();
            System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
            m.Translate(-rectF.X, -rectF.Y);
            path.Transform(m);

            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);
            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.FillPath(brush, path);
                    return gdi.ToBitmap();
                }
            }
            return null;
        }
Exemplo n.º 6
0
        public static Bitmap CreateFillPolygon(Device d, GraphicsPath path, Brush brush)
        {
            RectangleF rectF = path.GetBounds();

            System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
            m.Translate(-rectF.X, -rectF.Y);
            path.Transform(m);

            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);

            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.FillPath(brush, path);
                    return(gdi.ToBitmap());
                }
            }
            return(null);
        }
Exemplo n.º 7
0
        public static Bitmap CreateLine(Device d, GraphicsPath path, Pen pen, bool show_joints)
        {
            RectangleF rectF = path.GetBounds();

            System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
            m.Translate(-rectF.X, -rectF.Y);
            path.Transform(m);

            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);

            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.DrawPath(pen, path);
                    return(gdi.ToBitmap());
                }
            }
            return(null);
        }
Exemplo n.º 8
0
        public static Bitmap CreatePolygon(Device d, GraphicsPath path, Pen pen)
        {
            RectangleF rectF = path.GetBounds();

            System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
            m.Translate(-rectF.X, -rectF.Y);
            path.Transform(m);

            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);

            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                g.SmoothingMode = SmoothingMode.AntiAlias;
                if (g != null)
                {
                    g.DrawPath(pen, path);
                    return(gdi.ToBitmap());
                }
            }
            return(null);
        }
Exemplo n.º 9
0
 public static Bitmap CreatePolygon(Device d, GraphicsPath path, Pen pen)
 {
     RectangleF rectF = path.GetBounds();
     System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
     m.Translate(-rectF.X, -rectF.Y);
     path.Transform(m);
     
     AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);
     if (gdi != null)
     {
         Graphics g = gdi.GetGraphics();
         g.SmoothingMode = SmoothingMode.AntiAlias;
         if (g != null)
         {
             g.DrawPath(pen, path);
             return gdi.ToBitmap();
         }
     }
     return null;
 }
Exemplo n.º 10
0
        public static Bitmap CreateLine(Device d, GraphicsPath path, Pen pen, bool show_joints)
        {
            RectangleF rectF = path.GetBounds();
            System.Drawing.Drawing2D.Matrix m = new System.Drawing.Drawing2D.Matrix();
            m.Translate(-rectF.X, -rectF.Y);
            path.Transform(m);

            AGT_TextureResource gdi = new AGT_TextureResource(rectF.Width, rectF.Height);
            if (gdi != null)
            {
                Graphics g = gdi.GetGraphics();
                if (g != null)
                {
                    g.DrawPath(pen, path);
                    return gdi.ToBitmap();
                }
            }
            return null;
        }