图片读取

This commit is contained in:
daiqingshuang
2025-03-25 18:37:06 +08:00
parent 3333dacdce
commit 7dbcc93d1a
11 changed files with 10247 additions and 12 deletions

View File

@@ -6,11 +6,23 @@
#include "window/mwindow.h"
#include "widget/compound_widget/mbutton.h"
#include "widget/panel_widget/mbox.h"
#include "misc/pixel.h"
#define STB_IMAGE_IMPLEMENTATION
#include "misc/stb_image.h"
#include "misc/mapped_file/mapped_file.h"
int main(int argc, char* argv[]) {
mirage_app app;
app.init();
auto file = mapped_file::create();
file->map_file(L"Z:/Root/Local/NanakoDisk/涩图/可爱偷猴计划/东风谷早苗/57092520_p1.jpg");
int x, y, channels, req_channels = 4;
stbi_load_from_memory((stbi_uc*)file->get_data(), file->get_size(), &x, &y, &channels, req_channels);
auto accessor = pixel_factory::create_image_accessor(SG_PIXELFORMAT_RGBA8, file->get_data(), x, y);
auto window = std::make_shared<mwindow>();
window->create_window(800, 600, L"Hello, World!");
window->show();