mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Image type: some more docs
This commit is contained in:
parent
0b3fecf300
commit
8e44ac2351
4 changed files with 16 additions and 7 deletions
|
@ -21,18 +21,20 @@ struct Image
|
|||
public:
|
||||
Image() : data(Data::None()) { }
|
||||
|
||||
/// Load an image from an image file
|
||||
static Image load_from_path(const SharedString &file_path) {
|
||||
Image img;
|
||||
img.data = Data::AbsoluteFilePath(file_path);
|
||||
return img;
|
||||
}
|
||||
|
||||
/*
|
||||
static Image load_from_argb(int width, int height, const SharedVector<uint32_t> &data) {
|
||||
Image img;
|
||||
img.data = Data::EmbeddedRgbaImage(width, height, data);
|
||||
return img;
|
||||
}
|
||||
|
||||
*/
|
||||
friend bool operator==(const Image &a, const Image &b) {
|
||||
return a.data == b.data;
|
||||
}
|
||||
|
@ -40,7 +42,6 @@ public:
|
|||
return a.data != b.data;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
using Tag = cbindgen_private::types::ImageReference::Tag;
|
||||
using Data = cbindgen_private::types::Image;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue