[]
You can insert pictures into Word documents to enhance their presentation and visual structure. Use the AddPicture method to insert a picture, and the RtfHorizontalAlignment enumeration to set its horizontal alignment.
The following example adds a picture to a document and centers it horizontally:
using C1.Word;
using GcImage = GrapeCity.Documents.Drawing.Image; // AddPicture expects a GrapeCity.Documents.Drawing.Image
C1WordDocument doc = new C1WordDocument();
// Load the image
GcImage image = GcImage.FromFile(@"path\to\image.png");
// Add the image, centered horizontally
doc.AddPicture(image, RtfHorizontalAlignment.Center);The document resembles the following image:
