Scripts Index
ASP.NET Tips and Tutorials Image Manipulation  

Aspose.Imaging for .NET

download download home home   report broken
important script information
company name:
Aspose
license: Shareware
minimum requirements:
functional limitations:
Aspose.Imaging for .NET description
Aspose.Imaging for .Net API supports two different approaches for cropping image: by shifts and by rectangle. The EmfImage class provides an overloaded version of the Crop method that accepts 4 integer values denoting Left, Right, Top & Bottom. Based on these four values, the Crop method moves the image boundaries toward the center of the image while discarding the outer portion. The EmfImage class provides another overloaded version of the Crop method that accepts an instance of the Rectangle class. You can cut out any portion of an image by providing the desired boundaries to the Rectangle object.

// Cropping by Shifts

//[C# Code Sample]

// create an instance of Rasterization options
EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;

// create an instance of PNG options
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions;

//Declare variables to store file paths for input and output images
string filePath = @"TestEmfBezier.emf";
string outPath = filePath + ".pdf";

//Load an existing image into an instance of EMF class
using (Aspose.Imaging.FileFormats.Emf.EmfImage image = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(filePath))
{
using (FileStream outputStream = new FileStream(outPath, FileMode.Create))
{
//Based on the shift values, apply the cropping on image
//Crop method will shift the image bounds toward the center of image
image.Crop(30, 40, 50, 60);

// Set height and width
pdfOptions.VectorRasterizationOptions.PageWidth = image.Width;
pdfOptions.VectorRasterizationOptions.PageHeight = image.Height;

//Save the results to disk
image.Save(outputStream, pdfOptions);
}
}

//[VB.NET Code Sample]

' create an instance of Rasterization options
Dim emfRasterizationOptions As New EmfRasterizationOptions()
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke

' create an instance of PNG options
Dim pdfOptions As New PdfOptions()
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions

'Declare variables to store file paths for input and output images
Dim filePath As String = "TestEmfBezier.emf"
Dim outPath As String = filePath & Convert.ToString(".pdf")

'Load an existing image into an instance of EMF class
Using image As Aspose.Imaging.FileFormats.Emf.EmfImage = DirectCast(Aspose.Imaging.Image.Load(filePath), Aspose.Imaging.FileFormats.Emf.EmfImage)
Using outputStream As New FileStream(outPath, FileMode.Create)
'Based on the shift values, apply the cropping on image
'Crop method will shift the image bounds toward the center of image
image.Crop(30, 40, 50, 60)

' Set height and width
pdfOptions.VectorRasterizationOptions.PageWidth = image.Width
pdfOptions.VectorRasterizationOptions.PageHeight = image.Height

'Save the results to disk
image.Save(outputStream, pdfOptions)
End Using
End Using

// Cropping by Rectangle

//[C# Code Sample]

// create an instance of Rasterization options
EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke;

// create an instance of PNG options
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions;

//Declare variables to store file paths for input and output images
string filePath = @"TestEmfExtPen.emf";
string outPath = filePath + ".pdf";

//Load an existing image into an instance of EMF class
using (Aspose.Imaging.FileFormats.Emf.EmfImage image = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(filePath))
{
using (FileStream outputStream = new FileStream(outPath, FileMode.Create))
{
//Create an instance of Rectangle class with desired size
//Perform the crop operation on object of Rectangle class
image.Crop(new Aspose.Imaging.Rectangle(30, 50, 100, 150));

// Set height and width
pdfOptions.VectorRasterizationOptions.PageWidth = image.Width;
pdfOptions.VectorRasterizationOptions.PageHeight = image.Height;

//Save the results to disk
image.Save(outputStream, pdfOptions);
}
}

//[VB.NET Code Sample]

' create an instance of Rasterization options
Dim emfRasterizationOptions As New EmfRasterizationOptions()
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.WhiteSmoke

' create an instance of PNG options
Dim pdfOptions As New PdfOptions()
pdfOptions.VectorRasterizationOptions = emfRasterizationOptions

'Declare variables to store file paths for input and output images
Dim filePath As String = "TestEmfExtPen.emf"
Dim outPath As String = filePath & Convert.ToString(".pdf")

'Load an existing image into an instance of EMF class
Using image As Aspose.Imaging.FileFormats.Emf.EmfImage = DirectCast(Aspose.Imaging.Image.Load(filePath), Aspose.Imaging.FileFormats.Emf.EmfImage)
Using outputStream As New FileStream(outPath, FileMode.Create)
'Create an instance of Rectangle class with desired size
'Perform the crop operation on object of Rectangle class
image.Crop(New Aspose.Imaging.Rectangle(30, 50, 100, 150))

' Set height and width
pdfOptions.VectorRasterizationOptions.PageWidth = image.Width
pdfOptions.VectorRasterizationOptions.PageHeight = image.Height

'Save the results to disk
image.Save(outputStream, pdfOptions)
End Using
End Using
Similar scripts
Rotated Text Image Overlay Control (Popularity: ) : This is an article in which the author elaborately discusses about rotated text image overlay control. The author explains that this will be useful for the users to learn about overlaying certain text on every image, turning each tab, button ...
Adding text to an image in memory (Popularity: ) : This tutorial will be of much use for the users in generating dynamic navigation button on their ASP.NET websites. This article guides users to include a text to the images in memory by using System.Drawing.Bitmap and draw brush. This is ...
Image manipulation in ASP.NET with system.drawing (Popularity: ) : Image manipulation in ASP.NET with system.drawing is a simple tutorial in which the author elaborates the method of creating images with the help of objects which reside on the system.drawing namespace. The author also explains about outputting the created images ...
A Robust Image Gallery for ASP.NET (Popularity: ) : This tutorial can be used as a guidance and reference to build an enhanced image gallery on websites. In this tutorial the author elaborately discusses about generating image gallery with categories. This tutorial covers on topics such as developing the ...
Dynamically Changing Database Stored Image Sizes (Popularity: ) : Dynamically Changing Database Stored Image Sizes is an easy to understand tutorial in which the author demonstrates the process of changing the size of the images that are stored in the database. In this tutorial the author discusses about the ...
Basic image processing with ASP.NET (Popularity: ) : Using this article users can learn about using System.Drawing namespace in image processing with ASP.NET. This tutorial explains that using System.Drawing one can take the advantages of the graphic functionalities of GDI+ and suggests users to use other namespaces such ...
Uploading, Determining Size, Width and Height and Resizing Image Files with ASP.NET (Popularity: ) : Uploading, Determining Size, Width and Height and Resizing Image Files with ASP.NET is an article in which the programmers can gather information about uploading the images and determining the size of the uploaded images. The author explains the method of ...
INFO: Determine the JPEG Quality Factor by Using C# .NET (Popularity: ) : This is a tutorial where users can find information about JPEG quality factor and setting JPEG quality factor with C#.NET. Here this tutorial explains that JPEG quality factor has the ability to generate two quantization tables that play an important ...
True Image Resizing (Popularity: ) : This is an online tutorial that can be utilized by the users to perform the size adjusment for the images using System.Drawing namespace. Here the author clearly explains about resizing the images without disturbing the file size. This tutorial discusses ...
ComboBox With Images (Popularity: ) : In this tutorial readers can find information on displaying images in ComboBox. The author explains that, due to the absence of in built support for images in ComboBox there is a need to generate a ComboBoxEx class for displaying images ...
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Similar Software
Aspose.Imaging for .NET (Popularity: ) : Overview

Aspose.Imaging for .NET is an imaging library that empowers the developers to create, edit, draw or convert images in their .NET application with ease and performance.
Aspose.Imaging for .NET is flexible enough to meet the needs of all your ...

Aspose.Pdf for .NET (Popularity: ) : Aspose.Pdf is a .Net component for writing Pdf documents without using Adobe Acrobat. It supports converting HTML, XSL-FO & Word documents to PDF and you can also create PDF by API, XML templates or XSL-FO files. Other supported features include ...
Aspose.Diagram for .NET (Popularity: ) : Aspose.Diagram is a class library for working with MS Visio files & is a pure .NET alternate for MS Visio Object Model. It enables developers to work with VSD, VDX & Visio 2013 VSDX files on ASP.NET web applications, web ...
Aspose.OCR for .NET (Popularity: ) : Aspose.OCR for .NET is a character recognition component built to allow developers to add OCR functionality in their ASP .NET web applications, web services and Windows applications. It provides a simple set of classes for controlling character recognition.

The API ...

Aspose.Cells for SharePoint (Popularity: ) : Aspose.Cells for SharePoint is a flexible solution for converting Excel documents into multiple document formats within Microsoft SharePoint applications. Now you can easily convert documents right from the SharePoint document library into popular formats like XLS, XLSX, CSV, HTML, ODS, ...
Aspose.BarCode for .NET (Popularity: ) : Aspose.BarCode is a .NET component for generation and recognition of Linear and 2D barcodes on all kinds of .NET applications. It supports WPF with 29+ Barcode symbologies like OneCode, QR, Aztec, MSI, EAN128, EAN14, SSCC18, Code128, Code39, Postnet, MarcoPDF417, Datamatrix, ...
Aspose.Email for .NET (Popularity: ) : Aspose.Email for .NET is a collection of components for working with email from within ASP.NET web applications, web services or Windows applications. It makes it easy to work with Outlook PST, EML, MSG and MHT files.

Aspose.Email makes it easy ...

Aspose.Imaging for Java (Popularity: ) : Aspose.Imaging for Java is an easy-to-use, high-performance and well-documented imaging library, that provides the most flexible group of routines for the developers to create, manipulate, save and convert images in their Java applications with ease and performance. Aspose.Imaging provides features ...
Aspose.Tasks for .NET (Popularity: ) : Aspose.Tasks is a .NET project® management component that enables .NET applications to read, write and modify Microsoft Project® documents as well as MPX (Microsoft Project eXchange), MPP projects (native MS Project 98 - 2007 format), MPD format (MS Project Server ...
Coyote Tracing for .NET (Popularity: ) : Coyote Tracing for .NET is a powerful solution that provides easy to use tracing, logging and live monitoring capabilities for distributed and non-distributed .NET applications.
* Send and distribute Trace Messages using the royalty-free Coyote Core Framework.
* Collect and ...

ad


Rate me
supported os
Linux
Windows 2000
Windows 2003
Windows 98
Windows XP
Android 1.2+
stats
downloads 11
price $599
version 2.5
size in Kb 8,151
popularity   
1990/370771
user rating 5/10
New Scripts
Popular Scripts
Latest Reviews