1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:07:36 +00:00

PixelPaint: Save and load to and from disk

Store a PixelPaint project in a .pp file (as there doesn't seem to
be any real standard on this). It's a very simple json file that
contains the bitmap as a base64 encoded bmp.
This commit is contained in:
BenJilks 2020-10-18 14:44:33 +00:00 committed by Andreas Kling
parent 216385084b
commit d8474d80f2
4 changed files with 94 additions and 4 deletions

View file

@ -53,6 +53,7 @@ public:
class Image : public RefCounted<Image> {
public:
static RefPtr<Image> create_with_size(const Gfx::IntSize&);
static RefPtr<Image> create_from_file(const String& file_path);
size_t layer_count() const { return m_layers.size(); }
const Layer& layer(size_t index) const { return m_layers.at(index); }
@ -66,6 +67,7 @@ public:
void restore_snapshot(const Image&);
void paint_into(GUI::Painter&, const Gfx::IntRect& dest_rect);
void save(const String& file_path) const;
void move_layer_to_front(Layer&);
void move_layer_to_back(Layer&);