Link Search Menu Expand Document

Add Images - VB.NET

Spreadsheet SDK sample in VB.NET demonstrating ‘Add Images’

Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.IO
Imports System.Text
Imports Bytescout.Spreadsheet

Class Program
	Friend Shared Sub Main(args As String())
		' Create spreadsheet
		Dim doc As New Spreadsheet()
		' Add worksheet
		Dim worksheet As Worksheet = doc.Worksheets.Add()

		' Put an image on the worksheet with 10 pixel margin from the top-left corner of the worksheet
		worksheet.Pictures.Add("image1.jpg", 10, 10)
		' Put second image to 200 pixel offset and resize it to 250x200 px
		worksheet.Pictures.Add("image2.jpg", 200, 200, 250, 200)

		' Delete output file if exists
		If File.Exists("output.xls") Then
		End If

		' Save document

		' Close spreadsheet

		' Open generated XLS document in default application

	End Sub
End Class

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK