Method Image
- Namespace
- DocWright.Composition
- Assembly
- DocWright.Composition.dll
Image(byte[], string)
Places an inline picture sized from the image's own pixel dimensions at 96 DPI.
This overload decodes the image to learn its size, because the model carries display extent rather than intrinsic size. PNG and JPEG only. Pass explicit dimensions to avoid the decode.
void Image(byte[] imageBytes, string contentType)
Parameters
imageBytesbyte[]The encoded image bytes.
contentTypestringThe image content type, for example "image/png".
Exceptions
- ArgumentNullException
A required argument is null.
- ArgumentException
The bytes are empty, or the content type is not an image type.
- InvalidDocumentException
The image is not a PNG or JPEG, or cannot be decoded.
Image(byte[], string, double, double, Unit)
Places an inline picture at an explicit display size.
void Image(byte[] imageBytes, string contentType, double width, double height, Unit unit = Unit.Point)
Parameters
imageBytesbyte[]The encoded image bytes.
contentTypestringThe image content type, for example "image/png".
widthdoubleThe display width.
heightdoubleThe display height.
unitUnitThe unit the dimensions are expressed in.
Exceptions
- ArgumentNullException
A required argument is null.
- ArgumentException
The bytes are empty, or the content type is not an image type.
- ArgumentOutOfRangeException
A dimension is not a positive finite number.