Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The namespace of system.Drawing provides the access to basic GDI+ graphic function. In the namespace of System.Drawing.Drawing2D, System.Drawing.Imaging and System.Drawing.Text , .Net provides more advanced functionalities.</p> <pre><code>using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Text; </code></pre> <p>Create canvas and fill the background</p> <pre><code>Bitmap objBitmap; Graphics objGraphics; objBitmap = new Bitmap(400, 440); objGraphics = Graphics.FromImage(objBitmap); objGraphics.Clear(Color.White); </code></pre> <p>Draw the pie and fill</p> <pre><code>Pen p=new Pen(Color.Yellow,0); Rectangle rect=new Rectangle(10,10,280,280); objGraphics.DrawEllipse(p,rect); Brush b1=new SolidBrush(Color.Red); Brush b2=new SolidBrush(Color.Green); Brush b3=new SolidBrush(Color.Blue); objGraphics.FillPie(b1, rect, 0f, 60f); objGraphics.FillPie(b2, rect, 60f, 150f); objGraphics.FillPie(b3, rect, 210f, 150f); </code></pre> <p>Draw font</p> <pre><code>FontFamily fontfml = new FontFamily(GenericFontFamilies.Serif); Font font = new Font(fontfml, 16); SolidBrush brush = new SolidBrush(Color.Blue); objGraphics.DrawString("Drawing Graphics", font, brush, 70, 300); </code></pre> <p>Export and save to picture</p> <pre><code>objBitmap.Save(Response.OutputStream, ImageFormat.Gif); objBitmap.Save(Server.MapPath("x.jpg"), ImageFormat.Jpeg); </code></pre> <p>End drawing</p> <pre><code>objBitmap.Dispose(); objGraphics.Dispose(); </code></pre> <p>Here is the refrence: <a href="http://programmingdiscussions.blogspot.com/2010/07/aspnet-graphics-tutorial.html" rel="nofollow">http://programmingdiscussions.blogspot.com/2010/07/aspnet-graphics-tutorial.html</a></p> <p><a href="http://www.developerfusion.com/article/2569/creating-images-on-the-fly-with-aspnet/" rel="nofollow">http://www.developerfusion.com/article/2569/creating-images-on-the-fly-with-aspnet/</a></p> <p><a href="http://www.c-sharpcorner.com/UploadFile/steve_hall/drawinglinechart02072007053420AM/drawinglinechart.aspx" rel="nofollow">http://www.c-sharpcorner.com/UploadFile/steve_hall/drawinglinechart02072007053420AM/drawinglinechart.aspx</a></p> <p>Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload