Guide for VB.NET
Core Document Formats
Excel to Bitmap
Additional Features

VB.NET Excel - Render Excel to BMP Image

VB.NET Excel Converting Project to Render and Convert Excel to BMP

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

Have you ever looked for an Excel converter, let's say, such as RasterEdge VB.NET Excel Converting library to render and conevrt Excel document into raster BMP image? In this page, this problem will be solved from a few aspects below:
Related .net document control helps: view excel in browser: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
document viewer c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer... mvc display tiff: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control office viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications pdf editor component: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents view powerpoint: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET edit pdf text control: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
  • Why should I convert Excel to BMP image? And what can RasterEdge VB.NET Excel to BMP converting toolkit do?
  • What sholud I prepare for using your Excel to BMP converter and exporter in Visual Basic .NET language?
  • How to convert and transform single or batch Excel spreadsheets into BMP files in VB?
Why Convert
Excel is an important software for office work and belongs to Microsift Office range. It always shows so great capability on data summarizing and processing that it needs to be encytped while uploading, tramsfroming or printing. Unfortunately, Excel itself can not set a password just like PDF document against arbitrary operation. To this end, it is quite necessary to take this weakness into consideration with a totally opposite situation by converting Excel to image, such as Excel to Bitmap file, if so, you can read and process the content of Excel without any worry.
What described above are the exact desiging concepts of RasterEdge .NET Excel to BMP converter within VB project (other .NET platforms: C#.NET, ASP.NET & .NET Windows Forms are certainly supported).

Excel to BMP

With this well developed Excel to BMP rendering and converting control in VB.NET class, users are completely capable of rendering and transfroming Excel file into Bitmap format both in single and batch conevrsion modes. And more, the converted BMP image can be saved to either in the form of local file or memory stream with the relibale image saving methods.
For using this VB.NET Excel to BMP converting component, users need to make sure that your Excel is in 2007 or any greater version. Besides, it supports .NET Framework 2.0, 3.0, 3.5, 4.0 & 4.5 and Visual Studio 2005, 2008, 2010 & 2012.
Do the Conversion
In this part, we will guide users to render and convert Excel document to BMP file in three parts: creating a proper VB.NET Excel converting project in Windows desktop, calling Excel to BMP conversion APIs and methods and programming Excel to BMP with the shown sample code.

VB.NET Excel to BMP Project

Creating and building an Excel converting application with VB programming language can be an easy task even you are a fresh man to Visual Studio. After this first step, users need to implement the requiring "RasterEdge.Imaging.Basic.dll" and "RasterEdge.Imaging.MSExcel.dll" references to your created VB.NET application. Last, copy your unique developer license to the project to activate the Excel to BMP function.

Conversion APIs

Listed blow are the whole APIs and methods needed to render and convert Excel document to BMP image in VB.NET programming. If you want to do more Excel conversions, the "SaveImageFile" method will be indispensable and great helpful.
' Render Excel to get a REImage collection, or choose specific page to render
Private Function GetPage(pageIndex As Integer) As BasePage Implements XLSXDocument.GetPage
End Function
Private Function toImage() As BaseImage Implements XLSXPage.toImage
End Function
Private Function toImage(height As Integer, width As Integer) As BaseImage Implements XLSXPage.toImage
End Function

'Render Excel to desired document image format
Private Sub SaveImageFile(image As REImage, filePath As [String]) Implements REFile.SaveImageFile
End Sub
APIs instructions:
  • "XLSXDocument": stands for an abstraction concept of Excel file and contains the entire XLSXPage functions. An Excel file will be transformed into XLSXDocument as long as input to VB.NET Excel document project
  • "XLSXPage": is subodinate to ExcelDocuemnt, and represents for practical applications of Excel document viewing and editing SDK at page/sheet level
  • "GetPage": method used to load and select single or multiple Excel document pages in VB.NET project, you can define a certain page or the entire spreadsheets/pages to be rendered to images
  • "height As Integer, width As Integer": can be applied to set and adjust the rendered image's size in a valid parameter, including height and width
  • "SaveImageFile": used to convert and save the rendered image to another image or document format, including BMP - talked in this page

Code Example

Following sample code for conevrting Excel to BMP in VB class can be directly copied and run within your VB.NET Excel converting program. If you are interested in transforming Excel to other raster images and Excel converting library in VB.NET, please click the look.
''' <summary>
''' Render XLSXDocument to images of BMP Format
''' </summary>
''' <param name="ExcelFilePath"></param>
''' <returns></returns>
Public Function RenderXLSXDocumentToBMP(ExcelFilePath As [String]) As List(Of Stream)
' a list of stream which contains the image data of the bmp image.
Dim buffer As New List(Of Stream)()

Dim doc As New XLSXDocument(ExcelFilePath)
For i As Integer = 0 To doc.GetPageCount() - 1
Dim page As XLSXPage = DirectCast(doc.GetPage(i), XLSXPage)
Dim temp As REImage = DirectCast(page.ToImage(), REImage)
Dim imageStream As New MemoryStream()
If temp IsNot Nothing Then
temp.Convert(imageStream, ImageFormat.Bitmap)

End If

Return buffer
End Function

Recommend this to Google+ is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer 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, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster