FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DrawingImage

    struct · ferroui-base · v0.5.0

    struct DrawingImage
    

    An image that uses a Drawing for content.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<DrawingImage>
    

    Returns a strong reference to this object.

    Source

    drawing_property

    fn drawing_property() -> &'static StyledProperty<Option<Ref<Drawing>>>
    

    Defines the Drawing property.

    Source

    viewbox_property

    fn viewbox_property() -> &'static StyledProperty<Option<Rect>>
    

    Defines the Viewbox property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    with_drawing

    fn with_drawing(drawing: impl Into<Nullable<Drawing>>) -> Ref<Self>
    

    Creates an image showing drawing.

    Source

    invalidated

    fn invalidated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

    Raised when the image changes. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the image.

    Source

    raise_invalidated

    fn raise_invalidated(self: &Self)
    

    Raises the invalidated notification.

    Source

    drawing

    fn drawing(self: &Self) -> Option<Ref<Drawing>>
    

    The drawing content.

    Source

    set_drawing

    fn set_drawing(self: &Self, value: impl Into<Nullable<Drawing>>)
    

    Source

    viewbox

    fn viewbox(self: &Self) -> Option<Rect>
    

    A rectangular region of the drawing, in device independent pixels, to display when rendering this image.

    This value can be used to display only part of the drawing, or to surround it with empty space. If None, the bounds of the drawing are used.

    Source

    set_viewbox

    fn set_viewbox(self: &Self, value: Option<Rect>)
    

    Source

    size

    fn size(self: &Self) -> Size
    

    The size of the image, in device independent pixels.

    Source

    draw

    fn draw(self: &Self, context: &mut DrawingContext<'_>, source_rect: Rect, dest_rect: Rect)
    

    Draws the part of the drawing inside source_rect into dest_rect.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.