Visual C#.NET: Create New Images

How to create new images using C#.NET
Sometimes, developers need to create their own images. Yiigo Document Image products provides easy-to-use image creation method, allowing developers to create appropriate images and saved to desired output image format according to their needs. Find more image creation information on Yiigo.Image for .NET.
Yiigo.Image for .NET has those following functionalities:
  • Create an Image by Setting a Path
  • Creating an Image Using a Stream
  • Save created images into bitmap, jpeg, tiff, gif, png, etc.
  • Other image loading functions
This document provides comprehensive Visual C#.NET samples for guiding developers to create a new image using Yiigo.Image for .NET. Find more watermark creation tutorials on Create New Images in VB.NET, Web Imaging Viewer Image Creation and Create New Images in .NET Winforms.
Create New Images with C#.NET Sample Code

Requirements

Before creating image and documents using 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
  • Support Visual Studio 2005, 2010 and other .NET development environments
  • Yiigo.Image for .NET installation

Start to Create Image using Path

  • 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 "YiigoImagingLoadCsharp";
  • Right-click on the "References" folder, and select "Add Reference..." from the context 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;
using Yiigo.Imaging.Loading;

//Creates bmp image
YiigoImage.ImageTypes.Bitmap ImageTypes = new YiigoImage.ImageTypes.Bitmap();
ImageTypes.BitsPerPixel = 24;

//Define the source property
//Second boolean parameter determines if the file is temporal or not
ImageTypes.Source = new YiigoImage.Sources.FileCreateSource(@"C:\yiigo-example.bmp",false);

//Creates an instance of Image and call Create method by passing the Bitmap object
using (YiigoImage.Image image = YiigoImage.Image.Create(ImageTypes, 500, 500))
{
}

Start to Create Image using Stream

using System.IO;
using System.Drawing.Printing;
using Yiigo.Imaging;
using Yiigo.Imaging.Processing;
using Yiigo.Imaging.Loading;

//Creates an instance of Bitmap
YiigoImage.ImageTypes.Bitmap ImageTypes = new YiigoImage.ImageTypes.Bitmap();
ImageTypes.BitsPerPixel = 24;

//Create an instance of System.IO.Stream
System.IO.Stream stream = new System.IO.FileStream(@"C:\yiigo_example.bmp", System.IO.FileMode.Create);

//Define the source property for the instance of Bitmap
//Second boolean parameter determines if the Stream is disposed once get out of scope
ImageTypes.Source = new YiigoImage.Sources.StreamSource(stream, true);

//Creates an instance of Image and call Create method by passing the Bitmap object
using (YiigoImage.Image image = YiigoImage.Image.Create(ImageTypes, 500, 500))
{
}
Products
Other Plugins
Image Viewer CoreBarcode PluginPDF Read & WriteTesseract OCR PluginForm Processing PluginJBIG2 CodecJPEG2000 CodecISIS ScannerTwain ScannerDICOM ReaderCAD Scanner