Guide for VB.NET
Open & Create Image
Core Document Formats
Additional Features

VB.NET Imaging - Open and Save Image File in VB

How to Open, Save Images with VB.NET Codes in .NET Imaging Project

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

.NET Image Library for VB Project Overview
By using RasterEdge Image SDK for .NET, VB developers are enabled to freely open, edit and save any image / picture in your image processing application using Visual Basic .NET programming language. In fact, this imaging toolkit contains several image editing library components so that you can easily load / open an image in .NET, VB.NET, view and display a document such as PDF / Microsoft Office Word and multi-page TIFF file, edit and save the images and docs from a local file and screen.
This .NET image processing control library for VB.NET can be easily integrated into your program, on the condition that you have installed .NET Framework 2.0 or above, and Microsoft Visual Studio 2005 / 2008 / 2010 or 2012 version. To get started with image and document loading / opening and saving, you can create a Visual Basic .NET imaging application and then follow this guide.
This guide will present VB programmers with a demonstration on how to open and save image & document in your VB.NET imaging program, and listed below are the sections that will be mentioned later:
  • Visual Basic .NET file opening and saving library features
  • Visual Basic .NET methods to open and save images & documents
  • Visual Basic .NET sample codes for opening file, saving document from file and screen
Naturally you might prefer to some more image editing features apart from the file opening and saving functions, and RasterEdge.com provides you with powerful image processing functionality along with corresponding user manuals:
VB.NET Image Opening & Saving Features
  • Compatible with .NET developing environment such as Microsoft Visual Studio
  • Simple integration into VB.NET platforms such as Class Library and .NET WinForms
  • Easy to open an image or document in Visual Basic .NET applications
  • Demo codes provided to save an image or doc from local file or screen with VB.NET programming
  • Support common image formats such as Png, Jpeg, Gif, Tiff and Bmp
  • Also support document types like PDF, multi-page TIFF as well as Microsoft Word
VB.NET Methods to Open & Save File
Demonstrated in the two code tabs below are the Visual Basic .NET methods for opening and saving files, including png, jpeg, gif, tiff, bmp images, as well as PDF, multi-page TIFF and Microsoft Office Word documents. By using the Visual Basic .NET methods listed below, users are capable of opening an image or document restored in your local file, and also saving the document file to any file path within your system as you wish.

VB.NET Methods for Opening Doc or Image File

In the code tab below is the Visual Basic .NET methods for opening an image or document file from a local file in your program.
Public Shared Function OpenDocumentFile(filePath As String) As REDocument
End Function
Public Shared Function OpenDocumentFile(filePath As String, dec As BaseDecoder) As REDocument
End Function
Public Shared Function OpenImageFile(filePath As String) As REImage
End Function
Public Shared Function OpenImageFile(filePath As String, dec As BaseDecoder) As REImage
End Function

VB.NET Methods for Saving Doc or Image File

Listed in the code tab below are the Visual Basic methods for saving an image / picture or document into your local file.
Public Shared Sub SaveDocumentFile(document As REDocument, filePath As String)
End Sub
Public Shared Sub SaveDocumentFile(image As BaseImage, filePath As String, enc As BaseEncoder)
End Sub
Public Shared Sub SaveDocumentFile(images As List(Of BaseImage), filePath As String, enc As BaseEncoder)
End Sub
Public Shared Sub SaveDocumentFile(document As REDocument, filePath As String, enc As BaseEncoder)
End Sub
Public Shared Sub SaveImageFile(image As REImage, filePath As String)
End Sub
Public Shared Sub SaveImageFile(image As REImage, filePath As String, enc As BaseEncoder)
End Sub
VB.NET Sample Codes to Open & Save File
Here we have provided you with the complete Visual Basic .NET sample codes for opening and saving an image / document into your local file from your .NET image processing and editing program. All you need to do is simply download and install the RasterEdge .NET imaging SDK package, and build a VB.NET imaging application in your MS Visual Studio. After these, you can just copy VB demo codes below to your project for a test.

Open and Save Image from File

Imports RasterEdge.Imaging.Basic
Imports RasterEdge.Imaging.Basic.Core

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fileName As String = "c:/Sample.png"

Dim reImage As REImage = REFile.OpenImageFile(fileName)

REFile.SaveImageFile(reImage, "c:/reimage.bmp", New BMPEncoder())

End Sub
End Class

Open and Save Image from Screen

Imports RasterEdge.Imaging.Basic
Imports RasterEdge.Imaging.Basic.Core

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim reImage As New REImage()

' Get image from screen (flag to indicate if working area or not)
reImage.LoadImageFromGraphicScreen(True)

REFile.SaveImageFile(reImage, "c:/reimage.bmp", New BMPEncoder())

End Sub
End Class
More Imaging Tutorials!
See more how to start guidance for RasterEdge .NET Image SDK.


Recommend this to Google+