Visual C#.NET: Draw .NET Graphics on Image

How to draw .NET graphics on image using C#.NET
If you want to create some lines, ellipses, rectangles on images, you may use Yiigo.Image for .NET. We provide popular .NET graphics objects and allow to draw them on different images files.Find more image drawing information on Yiigo.Imaging for .NET Processing Support.
Yiigo.Image for .NET Processing SDK has those following functionalities:
This document provides comprehensive Visual C#.NET samples for guiding developers to draw image using Yiigo.Image for .NET. Find more .NET graphics drawing tutorials on Draw .NET Graphics in VB.NET, Web Imaging Viewer Draw .NET Graphics and Draw .NET Graphics in .NET Winforms.
Draw .NET Graphics on Image with C#.NET Sample Code

Requirements

Before drawing .NET graphics on image with Yiigo.Image for .NET in Visual C#.NET, make sure that you have installed.
  • Operating systems - Windows 7, Windows Vista, and Windows XP, etc
  • Compatible with .NET framework 2.0 and above versions
  • Compatible with .NET framework 2.0 and above versions
  • Yiigo.Image for .NET installation

Start to Draw .NET Graphics on Image

  • Open and run your Microsoft Visual Studio;
  • Choose either "Visual C# Projects" in "New Project" dialog box;
  • Choose "Windows Application" in the "Templates" List and name it "YiigoImagingDrawingNetGraphicsCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the con.NET graphics menu in the "Solution Explorer" window;
  • In the "Add Reference" dialog box, select the ".NET" tab and browse to Yiigo.Imaging.Net.dll library;
  • Add it to your Visual C# applications;
  • Call Yiigo .NET Image Namespace & Copy those following codes:
using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
// create Squares and Rectangles object on image
YiigoImage Image = new YiigoImage();

pubic void YiigoImageProcessDrawGraphics();
{
Image newImage = Image.FromFile("C:/Yiigo_example.jpg");
GraphicsType graphics = Graphics.Rectangle;
Pen myPen = new Pen(System.Drawing.Color.Red, 5);
Rectangle myRectangle = new Rectangle(20, 20, 70, 70);
}
pubic void YiigoImageProcessDrawGraphics(Graphics.Rectangle, System.Drawing.Color.Red, 5, new Rectangle(20, 20, 70, 70));
image.Save(("C:/Yiigo_example.jpg");

// create Lines object on image
YiigoImage Image = new YiigoImage();
pubic void YiigoImageProcessDrawGraphics();
{
Image newImage = Image.FromFile("C:/Yiigo_example.jpg");
GraphicsType graphics = Graphics.Line;
Pen myPen = new Pen(System.Drawing.Color.Red, 5);
point myPoint1 = new Point(0, 0);
point myPoint2 = new Point(0, 100);
}
pubic void YiigoImageProcessDrawGraphics(Graphics.Line, System.Drawing.Color.Red, 5, new Point(0, 0), new Point(0, 100));
image.Save(("C:/Yiigo_example.jpg");
// create Ellipses and Circles objects on image
public void DrawEllipse(Pen pen, int x, int y, int width, int height);
{
Image newImage = Image.FromFile("C:/Yiigo_example.jpg");
GraphicsType graphics = Graphics.Ellipse;
Pen myPen = new Pen(System.Drawing.Color.Blue, 3);
int x = "10";
int y = "50";
int width = "100";
int height = "120";
}
pubic void YiigoImageProcessDrawGraphics(Graphics.Ellipse, System.Drawing.Color.Blue, 3, "10", "50", "100", "120");
image.Save(("C:/Yiigo_example.jpg");
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner