Allow to load an image from memory

New `image::Handle` opaque type uniquely identifying some `image::Data`,
allowing reliable caching.
This commit is contained in:
Héctor Ramón Jiménez 2019-11-29 21:44:39 +01:00
parent 811d8b90d7
commit 505588d585
5 changed files with 133 additions and 33 deletions

View file

@ -1,5 +1,5 @@
use iced_native::{
Background, Color, Font, HorizontalAlignment, Rectangle, Vector,
image, Background, Color, Font, HorizontalAlignment, Rectangle, Vector,
VerticalAlignment,
};
@ -41,8 +41,8 @@ pub enum Primitive {
},
/// An image primitive
Image {
/// The path of the image
path: String,
/// The handle of the image
handle: image::Handle,
/// The bounds of the image
bounds: Rectangle,
},