Guide for VB.NET
Core Document Formats
Additional Features
Image Cropping

VB.NET Imaging - Crop Image Using VB.NET

VB.NET Image Cropper Control SDK to Cut Out Part of Image

VB.NET
Home > .NET Imaging SDK > VB.NET > Crop Image
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

VB.NET Image & Picture Cropping Application
Do you need to save a copy of certain part of an image file in a programming way? Do you need to cut out certain unwanted part from one image file by VB.NET code? If you have one yes for above questions, then this mature VB.NET image cropping control SDK may arise your interest. Fully developed in .NET Framework application, this VB.NET image cropper library SDK provides a professional and easy to use .NET solution for developers to crop / cut out image file in a short time. Thus, this VB.NET image cropping control SDK is often used by developers for building a comprehensive and fully featured image editing application.
This online tutorial page will illustrate the image cropping function from following aspects.
  • Key functions of VB.NET image cropper control SDK
  • VB.NET image cropping method to crop picture / photo
  • VB.NET sample code for image cropping in .NET developing application
  • VB.NET image cropper library toolkit FAQs
VB.NET Image Cropper Control Features
  • Clean VB.NET image cropping library control that can be used in cross-platform applications
  • Able to crop common image file formats, like png, jpeg, gif, bmp and tiff, in VB.NET imaging application
  • The name and storage path of cropped image file is completely user defined using VB.NET code
  • Cropped image part can be saved as new file which is separate from source image file
  • Compact advanced VB.NET image cropping functions into small-size libraries
After you crop an area from source image file using VB.NET programming code, you are also allowed to conduct some basic editing applications toward cropped image. For example, you can adjust the size of created cropped image file, add antique effect to cropped image and rotate the orientation of cropped image using Visual Basic .NET code.
VB.NET Method for Image Cropping
In this section, we will brief illustrate the method that this VB.NET image cropper control SDK has used to cut out a rectangular section from source image. As this VB.NET image cropper control SDK adopts the application of X & Y location, the position of cropped rectangular section can be accurately defined. As for the size of chose rectangular section, developers can determine the cropping area by entering the width & height value directly. Note: the coordinates of left-top point of source image is (0, 0).
Public Shared Function ApplyCrop(img As REImage, x As Integer, y As Integer, width As Integer, height As Integer) As Integer
End Function
VB.NET Demo Code to Crop Image
In this section, you will find a complete VB.NET code demo which is used to help you have a quicker grasp of this VB.NET image cropping process: decode the source image file to bitmap, crop bitmap and save cropped bitmap to original image format. After you run this VB.NET sample code in your .NET class application, the original source image file will not be changed and a new image file will be created which contains your desired image part.
Imports RasterEdge.Imaging.Basic
Imports RasterEdge.Imaging.Basic.Core
Imports RasterEdge.Imaging.Processing
Imports RasterEdge.Imaging.Basic.Codec

Namespace RE__Test
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub

Private Sub button1_Click(sender As Object, e As EventArgs)
Dim fileName As String = "c:/Sample.png"

Dim reImage As REImage = REFile.OpenImageFile(fileName)

ImageProcessing.ApplyCrop(reImage, 80, 80, 500, 500)

REFile.SaveImageFile(reImage, "c:/reimage.png", New PNGEncoder())
End Sub
End Class
End Namespace
VB.NET Image Cropping Library Add-on FAQs
Q 1: What are the installation requirements of this VB.NET image cropping control add-on?
A 1: RasterEdge VB.NET image cropping control add-on needs a PC running Windows XP or later windows operating systems, a .NET developing tool Microsoft Visual Studio 2005 or greater versions and .NET Framework 2.0 or later versions.

Q 2: If I crop a part from source image and save cropped part as a new file using this VB.NET image cropper library plug-in, does this newly created file have the same image quality with the original image file?
A 2: Yes, this VB.NET image cropper library SDK allows developers to cut out certain area from source image file without decreasing the original image quality.
More Tutorials!
Find more user guides with RasteEdge .NET Image SDK using VB.NET sample codings!


Recommend this to Google+