Img class Maps & 3D Scenes
Plain raster image with recommended size and aspect ratio.
Represents non-vector images backed by raw data (Uint8List) or loaded from assets. Unlike SDK-generated vector images (AbstractGeometryImg, LaneImg, etc.), Img has a recommended size and aspectRatio but can be resized to any dimensions (with possible quality loss for raster formats).
Create instances using the constructor with image data, or load from asset bundles using Img.fromAsset.
See also:
- ImgBase - Base class providing core image functionality
- RenderableImg - Container for rendered bytes with dimensions
- AbstractGeometryImg - For SDK-generated vector turn arrows
Constructors
- Img(Uint8List data, {ImageFileFormat format = ImageFileFormat.autoDetect})
-
Creates an image from raw byte data.
factory
- Img.init(int id)
Properties
- aspectRatio → double
-
SDK-recommended aspect ratio for proportional display.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasRegisteredAutoReleaseObject ↔ bool
-
getter/setter pairinherited
- imageType → ImageType
-
Category of this image indicating its source and purpose.
no setterinherited
- isScalable → bool
-
Whether the image uses a vector format and supports lossless scaling.
no setterinherited
- isValid → bool
-
Whether the SDK has valid image data available.
no setterinherited
- pointerId → int
-
The pointer ID of the native object
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Size
-
SDK-recommended dimensions for optimal rendering.
no setter
- uid → int
-
Unique identifier for this image instance.
no setterinherited
Methods
-
dispose(
) → void -
Disposes the native object.
inherited
-
getRenderableImage(
{Size? size, ImageFileFormat format = ImageFileFormat.png}) → RenderableImg? -
Retrieves image data with both bytes and actual rendered dimensions.
inherited
-
getRenderableImageBytes(
{Size? size, ImageFileFormat format = ImageFileFormat.png}) → Uint8List? -
Retrieves image bytes suitable for display with Image.memory.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerAutoReleaseObject(
int pointerId) → void -
Registers an object for auto release.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromAsset(
String key, {AssetBundle? bundle}) → Future< Img> - Loads an image from the app's asset bundle.