Image
Overview
Image is a class in Aspose.Note for Python.
Inherits from: CompositeNode.
The Image class provides properties for FileName, Bytes, OriginalWidth, OriginalHeight, and Alignment, and methods to replace the image data or change its alignment.
Image represents an embedded image within a OneNote page. It exposes the raw image bytes via Bytes, the original filename via FileName, and the stored dimensions via OriginalWidth and OriginalHeight. Enumerate images with document.GetChildNodes(Image) to extract and save all embedded images from a document in a single pass.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
FileName | str | None | Read | Gets or sets the image file name, if available |
FilePath | str | None | Read | Gets or sets the full path to the image file, if available |
Format | str | None | Read | Gets or sets the image format identifier (e.g., “png”, “jpeg”) |
Bytes | bytes | Read | Returns the raw binary data of the image |
OriginalWidth | float | None | Read | Gets or sets the original width of the image in points |
OriginalHeight | float | None | Read | Gets or sets the original height of the image in points |
Tags | list[NoteTag] | Read | Returns a list of NoteTag objects associated with the image |
Alignment | HorizontalAlignment | None | Read | Gets or sets the horizontal alignment of the image |
Width | float | None | Read | The rendered width of the image on the page canvas, or None |
Height | float | None | Read | The rendered height of the image on the page canvas, or None |
HorizontalOffset | float | None | Read | The horizontal position of the image on the page canvas, or None |
VerticalOffset | float | None | Read | The vertical position of the image on the page canvas, or None |
IsBackground | bool | None | Read | True if the image is a background image rather than inline content, or None |
LastModifiedTime | datetime | None | Read | The last-modified timestamp of the image element, or None |
AlternativeTextTitle | str | None | Read | The alternative text title for accessibility, or None |
AlternativeTextDescription | str | None | Read | The alternative text description for accessibility, or None |
HyperlinkUrl | str | None | Read | The URL of a hyperlink attached to this image, or None |
Methods
| Signature | Description |
|---|---|
__init__(FileName: str | None, FilePath: str | None, Format: str | None, Bytes: bytes, Width: float | None, Height: float | None, OriginalWidth: float | None, OriginalHeight: float | None, HorizontalOffset: float | None, VerticalOffset: float | None, Alignment: HorizontalAlignment | None, IsBackground: bool, LastModifiedTime: datetime | None, AlternativeTextTitle: str | None, AlternativeTextDescription: str | None, HyperlinkUrl: str | None, Tags: list[NoteTag] | None) | |
Replace(image: Image) | Replaces the current image with the provided Image instance |