...
Note: This feature requires PowerPointApplication
To programmatically set the alignment of the picture on the slide, use the Picture.Align method. Picture.Align takes an Alignment object as a parameter. The Alignment object can have the following values:
Name | Description | ||||||
---|---|---|---|---|---|---|---|
| Aligns the picture at the top of the slide. | ||||||
| Aligns the picture in the middle of the slide. | ||||||
| Aligns the picture on the bottom of the slide. | ||||||
| Aligns the picture on the left side of the slide. | ||||||
| Aligns the picture in the center of the slide. | ||||||
| Aligns the picture on the right side of the slide. |
Sample code
Code Block | ||||
---|---|---|---|---|
| ||||
//The ReadAllBytes method can be used to create a byte array from an image filepath. byte[] imgArray = File.ReadAllBytes(@"C:\image.png"); //create an object array of values to be populated object[] valuesArray = {imgArray}; //create a string array of column names. //the field names must match the data marker column names in the template. string[] colNamesArray = {"Logo(image(1,2,2))"}; //set the data source pptt.BindData(valuesArray, colNamesArray, "Company",pptt.CreateDataBindingProperties()); pptt.Process(); |
...