Class ImageUtilities
Useful methods for working with images in PDF files.
Inheritance
System.Object
ImageUtilities
Namespace: IronPdf.Imaging
Assembly: IronPdf.dll
Syntax
public static class ImageUtilities : Object
Methods
ImageToDataUri(Image, Boolean)
Turns a System.Drawing.Image or System.Drawing.Bitmap into a DataUri which can used to embed the Image directly into an HTML document.
Read standard https://en.wikipedia.org/wiki/Data_URI_scheme
Declaration
public static string ImageToDataUri(Image Image, bool Rasterize = false)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Image | Image | A non-null System.Drawing.Image or System.Drawing.Bitmap |
System.Boolean | Rasterize | Optional flag to flatten the image to raw pixels to increase compatibility with HTML (may affect PDF file size and rendering time) |
Returns
Type | Description |
---|---|
System.String | A data URL which can be used as the src attribute of an HTML <img tag |