图片类

This commit is contained in:
2025-03-26 18:21:12 +08:00
parent ed6722c297
commit 2c5ea1e7e9
3 changed files with 66 additions and 7 deletions

View File

@@ -9,10 +9,21 @@
#include "pixel.h"
#include "misc/mapped_file/mapped_file.h"
#include "stb_image_loader.h"
#include "render/render_image.h"
int main(int argc, char* argv[]) {
mirage_app::get().init();
auto file = mapped_file::create();
file->map_file(L"Z:/Root/Local/NanakoDisk/涩图/可爱偷猴计划/东风谷早苗/57092520_p1.jpg");
stb_image_loader image;
image.init(file->get_data(), file->get_size());
const auto& heap = image.load();
render_image i;
i.create(heap->data, { heap->info.width, heap->info.height }, heap->info.get_pixel_format());
const auto& window = mwindow::create({ 800, 600 }, L"Hello, World!");
window->set_content(
std::make_shared<mbutton>()