ByteScout Spreadsheet SDK - C# - Add Images to Spreadsheet - ByteScout

ByteScout Spreadsheet SDK – C# – Add Images to Spreadsheet

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – C# – Add Images to Spreadsheet

How to add images to spreadsheet in C# using ByteScout Spreadsheet SDK

This code in C# shows how to add images to spreadsheet with this how to tutorial

ByteScout tutorials are designed to explain the code for both C# beginners and advanced programmers. ByteScout Spreadsheet SDK is the SDK component for writing, reading, modifying and calculating Excel and CSV spreadsheets. Can calculate and reculculate formulas with Excel installed. You may import or export data to and from CSV, XML, JSON. Supports export to databases, arrays, streams and you can use it to add images to spreadsheet with C#.

This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly add images to spreadsheet in your C# application. In your C# project or application you may simply copy & paste the code and then run your app! Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

You can download free trial version of ByteScout Spreadsheet SDK from our website to see and try many others source code samples for C#.

Try ByteScout Spreadsheet SDK today: Get 60 Day Free Trial or sign up for Web API

Program.cs
      
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using Bytescout.Spreadsheet; namespace AddImages { class Program { static void Main(string[] args) { // Create spreadsheet Spreadsheet doc = new Spreadsheet(); // Add worksheet Worksheet 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")) { File.Delete("output.xls"); } // Save document doc.SaveAs("output.xls"); // Close spreadsheet doc.Close(); // Open generated XLS document in default application Process.Start("output.xls"); doc.Dispose(); } } }

Try ByteScout Spreadsheet SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Spreadsheet SDK page

Explore ByteScout Spreadsheet SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next