Question

I want to put an image file on a custom slide which is being created on the click of a custom button.

As I have applied image icons on the custom button through Resources folder of my application, is there a similar way I can put the image on the slide referencing the Resources folder, so that I need not mention the full path of the image file in the Slide.Shapes.AddPicture() method?

I am using C# VSTO to build the application.

Thanks.

Was it helpful?

Solution

Did it using the below code:

Image badge = Addin1.Properties.Resources.img; 
String path = Path.Combine(Path.GetTempPath (), "img.png"); 
badge.Save(path);

Remove the image after the image has been pasted on the slide, delete the image from the above path.

File.Delete(path);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top