Convert Image to Visio in C#

This article covers all the details on how to convert image to Visio in C#. It includes the stepwise guide and the running sample code to export PNG to Visio in C#. Moreover, you can generate both VSDX or VSD file formats by following this guide.

Steps to Convert Image to Visio in C#

  1. Install the Aspose.Diagram API to render an image in Visio format
  2. Initialize an instance of the Diagram class and access a page
  3. Insert an image as a Visio shape entity with the AddShape() method
  4. Render the output Visio diagram with the Save() method

These steps present an overview to convert PNG to Visio in C#. First, initiate a diagram and access one of its pages using the zero-based index number. Subsequently, insert the image as a shape and export the output Visio diagram as a VSD or VSDX file.

Code to Convert Image to Visio in C#

Use this sample code snippet to convert JPG to Visio in C#. However, you can improvise it according to your requirements to add multiple images and change the target page index, image position, height and width, etc. Finally, invoke the save method while specifying the target Visio format with the SaveFileFormat enumeration.

This tutorial has covered the information about exporting a picture to Visio in C#. Besides, if you want to learn to create an organizational chart, read the article on how to create an ORG chart in C#.

 English