Iced: images supported for wgpu integration?

Created on 24 Feb 2020  路  2Comments  路  Source: hecrj/iced

When I try to push image into row/column i get:

46 |             .push(Image::new(self.image.clone()))
   |              ^^^^ the trait `iced_native::widget::image::Renderer` is not implemented for `iced_wgpu::renderer::Renderer`
   |
   = note: required because of the requirements on the impl of `std::convert::From<iced_native::widget::image::Image>` for `iced_native::element::Element<'_, wgpu_backend::iced_pipeline::Message, iced_wgpu::renderer::Renderer>`
   = note: required because of the requirements on the impl of `std::convert::Into<iced_native::element::Element<'_, wgpu_backend::iced_pipeline::Message, iced_wgpu::renderer::Renderer>>` for `iced_native::widget::image::Image`

From example:

    pub fn view<'a>(&'a mut self, color: f32) -> Element<'a, Message, Renderer> {
        let content = Row::new()
            .spacing(20)
            .align_items(Align::End)
            .push(Image::new(self.image.clone()))
            .push(
                Column::new().spacing(20).push(
                    Row::new()
                        .align_items(Align::End)
                        .spacing(20)
                        .push(Text::new("Icon").size(30).width(Length::Fill)),
                ),
            );
        Container::new(content)
            .width(Length::Fill)
            .height(Length::Fill)
            .center_x()
            .center_y()
            .into()
}

self.image is image::Handle do i need to do different?

question

Most helpful comment

You need to enable the image feature.

All 2 comments

You need to enable the image feature.

Ah wonderful, thank so much for fast response!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Newbytee picture Newbytee  路  4Comments

aentity picture aentity  路  4Comments

cetra3 picture cetra3  路  3Comments

pbspbsingh picture pbspbsingh  路  4Comments

sumibi-yakitori picture sumibi-yakitori  路  3Comments