add export layers, export png, import brush padding

This commit is contained in:
2019-02-04 00:08:31 +01:00
parent a193666f4a
commit 24a6d0bae9
10 changed files with 266 additions and 65 deletions

View File

@@ -65,9 +65,14 @@ void NodePanelBrush::init()
std::string path_high = App::I.data_path + "/brushes/" + name + ".png";
std::string path_thumb = App::I.data_path + "/brushes/thumbs/" + name + ".png";
img = img.resize_squared();
img.gayscale_alpha();
auto thumb = img.resize(64, 64);
thumb.save(path_thumb);
img.save(path_high);
auto po2 = img.resize_power2();
po2.save(path_high);
async_start();
NodeButtonBrush* brush = new NodeButtonBrush;
@@ -75,7 +80,7 @@ void NodePanelBrush::init()
brush->init();
brush->create();
brush->loaded();
brush->set_icon(path.c_str());
brush->set_icon(path_thumb.c_str());
brush->thumb_path = path_thumb;
brush->high_path = path_high;
brush->brush_name = name;