FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CroppedBitmap

    struct · ferroui-base · v0.5.0

    struct CroppedBitmap
    

    Crops a bitmap.

    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<CroppedBitmap>
    

    Returns a strong reference to this object.

    Source

    dispose

    fn dispose(self: &Self)
    

    Releases the source bitmap.

    Source

    source_property

    fn source_property() -> &'static StyledProperty<Option<Rc<dyn IImage>>>
    

    Defines the Source property.

    Source

    source_rect_property

    fn source_rect_property() -> &'static StyledProperty<PixelRect>
    

    Defines the SourceRect property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    with_source

    fn with_source(source: Rc<dyn IImage>, source_rect: PixelRect) -> Ref<Self>
    

    Creates a cropped bitmap showing source_rect of source.

    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

    source

    fn source(self: &Self) -> Option<Rc<dyn IImage>>
    

    The source for the bitmap.

    Source

    set_source

    fn set_source(self: &Self, value: Option<Rc<dyn IImage>>)
    

    Source

    source_rect

    fn source_rect(self: &Self) -> PixelRect
    

    The rectangular area that the bitmap is cropped to.

    Source

    set_source_rect

    fn set_source_rect(self: &Self, value: PixelRect)
    

    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 cropped part of the source bitmap: source_rect is relative to the top left corner of the crop rectangle.

    Source

    Trait implementations

    Availability

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