Help on implementing "Image" variant for iced::core::Background #1825
Unanswered
gabrieldechichi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'd like to implement the Image variant for
iced::core::Background
and would like to ask the community for suggestions on the best way to approach it.The immediate problem is that
Background
is defined oncore
whereasimage
is defined innative
(which depends oncore
), so we can't add a direct reference tonative::image::Image
ornative::image::Handle
here.Is the best approach to create a generic
Image<Handle>
struct insidecore
, and have Background be generic as well? Then implementations on thenative
crate can require `impl Intoimage::Handle or something.Something like this:
core/image.rs
core/background.rs
Then handle the Image case here
graphis/src/renderer.rs
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions