FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IImage

    trait · ferroui-base · v0.5.0

    trait IImage: 'static
    

    Represents a bitmap or drawing which can be drawn.

    Implemented by the bitmap types and, through an adapter, by the image classes (cropped bitmaps and drawing images): a handle of such a class converts to Rc<dyn IImage> with into(). The as_* members replace interface casts (image as IBitmap).

    View source

    Members

    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 image to a drawing context: the part of the image inside source_rect is drawn into dest_rect.

    Source

    as_any

    fn as_any(self: &Self) -> &dyn Any
    

    The implementing value, for downcasts to concrete image types. For image classes use as_object.

    Source

    as_object

    fn as_object(self: &Self) -> Option<&FerroObject>
    

    The object behind the image when it is an image class.

    Source

    as_bitmap

    fn as_bitmap(self: &Self) -> Option<&dyn IBitmap>
    

    The image viewed as a bitmap, when it is one.

    Source

    as_affects_render

    fn as_affects_render(self: &Self) -> Option<&dyn IAffectsRender>
    

    The image viewed as IAffectsRender, when it can change.

    Source

    Trait implementations

    Availability

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