Skip to main content

ImageAnchor

ClassEnumSource

ImageAnchor.top_left = "top left"
ImageAnchor.top_center = "top center"
ImageAnchor.top_right = "top right"
ImageAnchor.left = "left"
ImageAnchor.center = "center"
ImageAnchor.right = "right"
ImageAnchor.bottom_left = "bottom left"
ImageAnchor.bottom_center = "bottom center"
ImageAnchor.bottom_right = "bottom right"

The image anchor.

Inspired by LaTeX/TikZ's node anchors. This value can help users put the image near another image easily.

For example, we can align the "top left" corner of an image to the same position of another image. Then the two image will share the same top-left corner position.

Enums​

NameTypeValue
top_leftstr"top left"
top_centerstr"top center"
top_rightstr"top right"
leftstr"left"
centerstr"center"
rightstr"right"
bottom_leftstr"bottom left"
bottom_centerstr"bottom center"
bottom_rightstr"bottom right"

Methods​

from_str​

v_1: Self = ImageAnchor.from_str(val: str | Self)

Use a str to define this size.

Requires​

NameTypeRequired
Description
valstr | SelfThe text used for conversion is flexible. For example, both "bottom-left" and "bottom left" will be converted to ImageAnchor.bottom_left.

Returns​

NameType
Description
v_1SelfThe converted anchor enum object.