ByteScout Spreadsheet SDK – C# – Add Background Image

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Add Background Image

ByteScout Spreadsheet SDK – C# – Add Background Image

Program.cs

using System.Diagnostics;
using System.Drawing;
using Bytescout.Spreadsheet;

namespace AddBackgroundImage
{
	class Program
	{
		static void Main(string[] args)
		{
			// Create new spreadsheet (or open existing)
			Spreadsheet doc = new Spreadsheet();
			doc.RegistrationName = "demo";
            doc.RegistrationKey = "demo";

			// Add worksheet
			Worksheet worksheet = doc.Worksheets.Add();

			// Put background image on the worksheet
			worksheet.BackgroundPicture = Image.FromFile("image1.jpg");
            
			// Save document
			doc.SaveAs("output.xls");

			// Close spreadsheet
			doc.Close();

			// Open generated XLS document in default application
			Process.Start("output.xls");

			doc.Dispose();
		}
	}
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next