Skip to content

When I use Image Widget, I want to initialize the image when creating it. How can I get the variables in AppState #2314

Open
@bluebell9

Description

@bluebell9

I have a question. When I use Image Widget, I want to initialize the image to get the variables in ImageList when creating it. Thank you for your answer
`fn image_list() -> impl Widget{

let image_buf = ImageBuf::from_file("E:/bizhi/00.jpg").unwrap();
let image_show = Image::new(image_buf).fill_mode(FillStrat::Contain).controller(ImageController{});
let size_box_image = SizedBox::new(image_show).height(50.).width(50.);

Flex::row()
    .with_flex_spacer(10.)
    .with_child(size_box_image)
    .with_flex_spacer(10.)

}`
Change the address E:/bizhi/00.jpg to the variable in ImageList
Thank you for your answer

Metadata

Metadata

Assignees

No one assigned

    Labels

    questioncauses uncertainty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions