Overloads
AddImage(IImage image)
Adds an image element to the document.
AddImage(Stream imageStream)
Creates and adds an image from a stream.
AddImage(string imagePath)
Creates and adds an image from a file path.
AddImage(IImage image)
IImage AddImage(IImage image)Adds an image element to the document.
Parameters
- image
- The image element to add.
AddImage(Stream imageStream)
IImage AddImage(Stream imageStream)Creates and adds an image from a stream.
Parameters
- imageStream
- The stream containing the image data.
Remarks
This method reads the image data from the stream and creates an image element that can be positioned and sized within the document.
AddImage(string imagePath)
IImage AddImage(string imagePath)Creates and adds an image from a file path.
Parameters
- imagePath
- The full path to the image file.
Remarks
This method loads the image from the specified file path and creates an image element that can be positioned and sized within the document.
Examples
AddImage(Stream imageStream)
csharp
1using var stream = File.OpenRead("logo.png");
2var doc = new VDocs();
3var image = doc.AddImage(stream);
4image.SetPosition(100, 200, Units.pt);
5image.SetDimensions(300, 200, Units.pt);
6
AddImage(string imagePath)
csharp
1var doc = new VDocs();
2var image = doc.AddImage("C:\\Images\\logo.png");
3image.SetPosition(100, 200, Units.pt);
4