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:
parent
216385084b
commit
d8474d80f2
4 changed files with 94 additions and 4 deletions
|
@ -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&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue