mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +00:00
Mandelbrot: Export images in a fixed resolution
This makes the exported image independent from the current window size and just always exports it at 1920x1080.
This commit is contained in:
parent
f2f728d39a
commit
92879383fb
1 changed files with 2 additions and 0 deletions
|
@ -221,7 +221,9 @@ void Mandelbrot::resize_event(GUI::ResizeEvent& event)
|
|||
|
||||
void Mandelbrot::export_image(String const& export_path)
|
||||
{
|
||||
m_set.resize(Gfx::IntSize { 1920, 1080 });
|
||||
auto png = Gfx::PNGWriter::encode(m_set.bitmap());
|
||||
m_set.resize(size());
|
||||
auto file = fopen(export_path.characters(), "wb");
|
||||
if (!file) {
|
||||
GUI::MessageBox::show(window(), String::formatted("Could not open '{}' for writing.", export_path), "Mandelbrot", GUI::MessageBox::Type::Error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue