GImage

A versatile image widget that supports various visual properties, layout, and interactions.

Example

#![allow(unused)]
fn main() {
use makepad_widgets::*;

live_design! {
    import makepad_widgets::base::*;
    import makepad_widgets::theme_desktop_dark::*; 
    import gen_components::components::*;
    import makepad_draw::shader::std::*;
    GImageExample = <ScrollYView>{
        height: 100.0,
        width: Fill,
        spacing: 20.0,
        <GLabel>{
            text: "GImage",
        }
        <GImage>{
            height: 32.0,
            width: 36.0,
            src: dep("crate://self/resources/rust.png"),
            rotation:30.0,
        }
        <GImage>{
            rotation: 1.0,
            opacity: 0.6,
            src: dep("crate://self/resources/robius.png"),
        }
        <GImage>{
            scale: 0.6,
            src: dep("crate://self/resources/robius.png"),
        }
        <GImage>{
            scale: 2.0,
            src: dep("crate://self/resources/robius.png"),
        }
       
        
    }
}
}

Props

decoratenametypedescription
livevisibleboolVisibility of the image.
liveopacityf32The opacity of the image.
livecursorOption<MouseCursor>The cursor type when hovering over the image.
livescalef64The scale of the image.
liverotationf32The rotation angle of the image.
walkwalkWalkThe positioning properties for the image.
layoutlayoutLayoutThe layout properties for the image.
redrawdraw_imageDrawCardThe component used for drawing the image.
livesrcLiveDependencyThe source dependency for the image's content.
rusttextureOption<Texture>The texture used for the image.

Event

No events specified for this widget.