Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface ISvgImage

interface ISvgImage
Extends ISvgNode Represents an SVG image element. The image element includes images inside SVG documents. It can display raster image files or other SVG files. See also - ISvgNode.

Methods

setX()

void setX(SvgLength x)
Sets the x attribute, which represents the X-coordinate of the image’s position. Default value is 0.0 with SvgUnit::Number

Parameters

x
SvgLength — Required SvgLength set as the X position of the image.

setY()

void setY(SvgLength y)
Sets the y attribute, which represents the Y-coordinate of the image’s position. Default value is 0.0 with SvgUnit::Number

Parameters

y
SvgLength — Required SvgLength to set as the Y position of the image.

setWidth()

void setWidth(SvgLength width)
Sets the width attribute, which represents the width of the image. Default value is 100.0 with SvgUnit::Percentage

Parameters

width
SvgLength — Required SvgLength to set as the width of the image.

setHeight()

void setHeight(SvgLength height)
Sets the height attribute, which represents the height of the image. Default value is 100.0 with SvgUnit::Percentage

Parameters

height
SvgLength — Required SvgLength to set as the height of the image.

getPreserveAspectRatio()

SvgPreserveAspectRatio getPreserveAspectRatio()
Retrieves the SvgPreserveAspectRatio attribute for the image.

Returns

SvgPreserveAspectRatio SvgPreserveAspectRatio value.

setPreserveAspectRatio()

void setPreserveAspectRatio(SvgPreserveAspectRatio aspectRatio)
Sets the SvgPreserveAspectRatio attribute for the image. Default value is @link SvgScale#MEET

Parameters

aspectRatio
SvgPreserveAspectRatio — Required SvgPreserveAspectRatio set for the image.

setHref()

void setHref(string href)
Sets the href attribute of the image element. Points at a URL for the image file. An empty string can be passed, indicating no reference.

Parameters

href
string — Required The string reference to set.
Last modified on October 29, 2026