Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Dec 21, 2022 · 0 comments
Labels
question causes uncertainty

Comments

@bluebell9
Copy link

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

@xStrom xStrom added the question causes uncertainty label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question causes uncertainty
Projects
None yet
Development

No branches or pull requests

2 participants