Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > ConvertToImage Method : ConvertToImage(Int32,Int32,Int32,Int32,ImageType,Stream) Method
First row index. One-based.
First column index. One-based.
Last row index. One-based.
Last column index. One-based.
Type of the image to create.
Stream to be converted to an image. It is ignored if null.

ConvertToImage(Int32,Int32,Int32,Int32,ImageType,Stream) Method

Converts the specified range into image with the specified type.
Syntax
'Declaration
 
Overloads Function ConvertToImage( _
   ByVal firstRow As Integer, _
   ByVal firstColumn As Integer, _
   ByVal lastRow As Integer, _
   ByVal lastColumn As Integer, _
   ByVal imageType As ImageType, _
   ByVal stream As Stream _
) As Image
'Usage
 
Dim instance As IWorksheet
Dim firstRow As Integer
Dim firstColumn As Integer
Dim lastRow As Integer
Dim lastColumn As Integer
Dim imageType As ImageType
Dim stream As Stream
Dim value As Image
 
value = instance.ConvertToImage(firstRow, firstColumn, lastRow, lastColumn, imageType, stream)

Parameters

firstRow
First row index. One-based.
firstColumn
First column index. One-based.
lastRow
Last row index. One-based.
lastColumn
Last column index. One-based.
imageType
Type of the image to create.
stream
Stream to be converted to an image. It is ignored if null.

Return Value

Converted Image for the specified range.
Remarks
Subscript/Superscript,RTF,Shrink to fit,Shapes (except TextBox shape and Image),Charts and Chart Worksheet and Complex conditional formatting features are not supported in Worksheet to image conversion. Gradient fill is partially supported This method is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
Example
MemoryStream stream = new MemoryStream();
// Converts the Range(R1C1 to R10C20) in worksheet to image.
sheet.ConvertToImage(1, 1, 10, 20, ImageType.Metafile, stream);
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also