Guide for VB.NET
Open Image from File
Core Document Formats
Additional Features

VB.NET Imaging - Load Image from File Using VB

How to Load Images from File or File Stream Using VB.NET Sample Codes

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

RasterEdge .NET Image SDK is a mature and powerful image processing toolkit which contains various image editing control libraries so that Visual Basic developers can easily import and load images from local files or from stream. If you have installed Microsoft Visual Studio, you can easily load any picture in Png, Jpeg, Gif, Tiff and Bmp image formats to your Visual Basic .NET imaging application for further processing.
This page will provide detailed guidance on how to load an image from file in your VB.NET image editing project, along with examples and VB.NET demo codes. Here are the main aspects that will be demonstrated later in this page:
  • How to load an image from local file with Visual Basic .NET programming language
  • How to load an image from file stream using Visual Basic .NET sample codes
  • Some more image viewing and loading examples in Visual Basic .NET codes
How to Load Images from Files in VB
VB.NET Image SDK Library provides multiple image processing features and functionality for you to edit an image as you wish. But before you get started, you need to load and import the image to your project first for display. We have demonstrated the corresponding VB.NET method and complete sample codes for loading and image restored in your local file.
In order to use the Visual Basic .NET sample codes below, developers are required to install the .NET Framework to your computer first. Supported versions include 2.0 and all the later versions. Apart from that, you need to install the Microsoft Visual Studio as well, currently supporting 2005 / 2008 / 2010 and 2012 versions. When these two requirements are met, you can build a new image processing project using VB.NET, such as a Windows application. Now you can freely copy the VB.NET sample codes listed below to your program for testing right now!

Load Image from VB Application Files Method

Below is the Visual Basic .NET method to load a single image or multiple ones from your local file to your image processing application. VB developers can freely modify the filename property in the codes.
Public Shared Sub New(filename As String)
End Sub

Load Image from Files VB.NET Example

Here are the full Visual Basic .NET demo codes for loading an image restored in your local and importing to your .NET image processing application.
This examples show you how to load a picture in png image format to import to your program. The picture is stored in your local disk C with the name "1.png". Of course it is understandable if you want to change the image file path and the picture file name so that you can test with your own local images / pictures.
Imports System.IO
Imports System.Drawing.Printing
Imports RasterEdge.Imaging
Imports RasterEdge.Imaging.Processing

Dim Image As New RasterEdgeImaging()


Load Image from Stream Method in VB

If your images are not saved in files but rather stored as stream, you can simply opt for this method to load your pictures from stream with the Visual Basic .NET method listed in the below code tab.
Public Shared Sub New(Stream As Stream)
End Sub

Load Image from Stream VB.NET Example

With Visual Basic .NET demo codes below, you will be able to load and open an image from your file stream named "1.png". In addition to the supported PNG image format, we also support loading images and pics in other image formats such as JPEG, GIF, TIFF and BMP. When evaluating this VB.NET imaging library with pictures of your own, please make sure you have make corresponding changes to the image format, file name and file path.
Imports System.IO
Imports System.Drawing.Printing
Imports RasterEdge.Imaging
Imports RasterEdge.Imaging.Processing

Dim Image As New RasterEdgeImaging()

Dim stream As New System.IO.FileStream("C:\1.png", System.IO.FileMode.Open)

Dim Image As New RasterEdgeImaging()
Image.LoadImageFromFileStream("C:\1.png", System.IO.FileMode.Open)
More Imaging Tutorials!

Recommend this to Google+ is professional provider of document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2015 Raster