2026-01-23 23:00:35 +00:00
|
|
|
#include "IPixelariumImageView.hpp"
|
|
|
|
|
|
|
|
|
|
#include <opencv2/imgcodecs.hpp>
|
|
|
|
|
|
|
|
|
|
#include "app_resources_default.h"
|
2026-02-08 12:09:02 +01:00
|
|
|
#include "imgui.h"
|
2026-01-23 23:00:35 +00:00
|
|
|
#include "portable-file-dialogs.h"
|
|
|
|
|
|
|
|
|
|
auto pixelarium::application::IPixelariumImageView::ImageViewMenuBar() -> void
|
|
|
|
|
{
|
|
|
|
|
if (ImGui::BeginMenuBar())
|
|
|
|
|
{
|
2026-02-08 12:09:02 +01:00
|
|
|
if (ImGui::BeginMenu("File"))
|
2026-01-23 23:00:35 +00:00
|
|
|
{
|
2026-02-08 12:09:02 +01:00
|
|
|
if (ImGui::MenuItem(SAVEAS))
|
2026-01-23 23:00:35 +00:00
|
|
|
{
|
2026-02-08 12:09:02 +01:00
|
|
|
auto dest = pfd::save_file("Save File", ".", {"Image Files", "*.png *.jpg *.jpeg *.tiff"},
|
|
|
|
|
pfd::opt::force_overwrite)
|
|
|
|
|
.result();
|
|
|
|
|
if (!dest.empty())
|
|
|
|
|
{
|
|
|
|
|
// this->img_->SaveImage(dest);
|
|
|
|
|
cv::imwrite(dest, cached_image_);
|
|
|
|
|
}
|
2026-01-23 23:00:35 +00:00
|
|
|
}
|
2026-02-08 12:09:02 +01:00
|
|
|
|
|
|
|
|
ImageViewMenuBarAdditions();
|
|
|
|
|
|
|
|
|
|
ImGui::EndMenu();
|
2026-01-23 23:00:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::EndMenuBar();
|
|
|
|
|
}
|
|
|
|
|
}
|