Image
Overview
Image is a class in Aspose.PDF FOSS for .NET.
Inherits from: BaseParagraph.
An image paragraph: a picture loaded from a file, a URL or a stream and laid out in the page flow (or at a fixed rectangle) when the document is built.
This class declares 4 methods for Image objects in .NET programs.
Available methods include: BaseParagraph, Clone, GetMimeType, Image.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: BackgroundColor, BitmapInfo, BitmapSize, Border, File, FileType, and 22 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Margin | MarginInfo | Read/Write | Outer margins. |
ImageStream | Stream | Read/Write | Gets or sets a stream holding the image data. |
File | string | Read/Write | Gets or sets the path of the image file, or an http(s) URL that is downloaded when the page is built. |
FixWidth | double | Read/Write | Gets or sets the drawn width in points. |
FixHeight | double | Read/Write | Gets or sets the drawn height in points. |
ImageScale | double | Read/Write | Gets or sets the image scale. |
IsBlackWhite | bool | Read/Write | Gets or sets the is black white. |
IsApplyResolution | bool | Read/Write | Gets or sets whether the image’s embedded DPI sets its natural size. |
BackgroundColor | Color | Read/Write | A colour painted under the image’s box before it is drawn – the box being the image and its Border bands. |
Border | BorderInfo | Read/Write | Rules drawn around the image, outside it: each side’s band widens the box the image occupies, the way a bordered paragraph’s do. |
FixedRectangle | Rectangle | Read/Write | Where the picture is drawn, in page space, when the CALLER places it: the flow draws it there on the page it has reached when the image’s turn comes, and moves nothing – the paragraph after it lands where it would have without it. |
FixBoxIsExact | bool | Read/Write | Whether a Fix box is the picture’s size whatever the content band: one wider or taller than the band keeps it and runs off the page’s edge instead of being brought down to the band. |
FitToBandWidth | bool | Read/Write | Whether an image with no fixed size is scaled, its aspect kept, to the WIDTH of the content band, whatever its height then is – up as well as down. |
FitToRemainingArea | bool | Read/Write | Whether an image with no fixed size is scaled, its aspect kept, to fill the width of the content band or the height still free on the page below the cursor – whichever binds first – growing as well as shrinking. |
Title | Aspose.Pdf.Text.TextFragment | Read/Write | Gets or sets a caption for the image. |
BitmapSize | Aspose.Pdf.Rectangle | Read | Pixel dimensions of the source image as a rectangle [0, 0, width, height], decoded from ImageStream or File. |
ImageFilterType | ImageFilterType | Read/Write | Gets or sets the compression filter to use for the embedded image. |
BitmapInfo | BitmapInfo | Read/Write | Optional in-memory pixel buffer (public-API compatibility). |
FileType | ImageFileType | Read/Write | Source file format hint. |
HorizontalAlignment | HorizontalAlignment | Read/Write | Horizontal alignment applied to this paragraph. |
VerticalAlignment | VerticalAlignment | Read/Write | Vertical alignment applied to this paragraph. |
IsFirstParagraphInColumn | bool | Read/Write | Force the paragraph to start a new column. |
IsKeptWithNext | bool | Read/Write | Keep this paragraph on the same page as the next one. |
IsInNewPage | bool | Read/Write | Force the paragraph to start on a new page. |
IsInLineParagraph | bool | Read/Write | Inline paragraph flag (does not start a new line). |
HyperlinkText | string? | Read/Write | Legacy string-typed hyperlink target. |
Hyperlink | Hyperlink? | Read/Write | Typed hyperlink decoration applied to the paragraph. |
ZIndex | int | Read/Write | Z-order index used by the DOM renderer. |
Methods
| Signature | Description |
|---|---|
Image() | Creates an image paragraph with no source; set File or ImageStream before the page is built. |
Clone() | Calls Clone on this Image instance. |
GetMimeType(i: System.Drawing.Image) | Best-effort MIME type for a System.Drawing.Image; returns “application/octet-stream” when the type cannot be determined. |
BaseParagraph() | Creates a paragraph with default alignment, an empty margin and no hyperlink. |