{"id":29538697,"url":"https://github.com/fantasywoc/vimag","last_synced_at":"2026-05-20T05:11:33.669Z","repository":{"id":304675191,"uuid":"1019551892","full_name":"fantasywoc/Vimag","owner":"fantasywoc","description":"轻量图像查看器","archived":false,"fork":false,"pushed_at":"2025-07-14T18:20:39.000Z","size":16702,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-14T18:26:54.278Z","etag":null,"topics":["cpp","cpp17","cross-platform","glew","glfw3","imageviewer","lightweight","nanovg","opengl","xmake"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fantasywoc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T13:57:38.000Z","updated_at":"2025-07-14T18:20:42.000Z","dependencies_parsed_at":"2025-07-14T18:40:20.774Z","dependency_job_id":null,"html_url":"https://github.com/fantasywoc/Vimag","commit_stats":null,"previous_names":["fantasywoc/vimag"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fantasywoc/Vimag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywoc%2FVimag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywoc%2FVimag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywoc%2FVimag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywoc%2FVimag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fantasywoc","download_url":"https://codeload.github.com/fantasywoc/Vimag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fantasywoc%2FVimag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265566797,"owners_count":23789345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp17","cross-platform","glew","glfw3","imageviewer","lightweight","nanovg","opengl","xmake"],"created_at":"2025-07-17T05:09:57.118Z","updated_at":"2026-05-20T05:11:33.662Z","avatar_url":"https://github.com/fantasywoc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VIMAG 轻量图片查看工具\r\n    \r\n\u003cdiv align=center\u003e\r\n\u003cimg src=\"./src/icons/logo.png\" width=\"150\" height=\"150\"\u003e\r\n\r\n\u003ch1\u003eVIMAG\u003c/h1\u003e\r\n\u003ch3\u003e完全开源免费的轻量图像查看软件\u003c/h3\u003e\r\n\u003ca href=\"https://github.com/fantasywoc/Vimag?tab=readme-ov-file\"\u003e\u003cimg src=\"https://img.shields.io/badge/Author-Fantasy-orange\" alt=\"Author\" /\u003e\u003c/a\u003e\r\n\u003cimg src=\"https://img.shields.io/github/languages/count/fantasywoc/Vimag\" alt=\"languages-count\" /\u003e\r\n\u003cimg src=\"https://img.shields.io/github/languages/top/fantasywoc/Vimag?color=yellow\" alt=\"languages-top\" /\u003e\r\n\u003cimg src=\"https://img.shields.io/github/last-commit/fantasywoc/Vimag\" alt=\"last-commit\" /\u003e\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\u003c/div\u003e\r\n\r\n\r\n# xmake编译项目\r\n## Debug模式\r\n```xmake config -m debug```\r\n\r\n## Release模式\r\n```xmake config -m release```\r\n\r\n## 清理构建\r\n```xmake clean```\r\n\r\n## 编译库配置\r\n```xmake g --pkg_searchdirs=./src/thrity_party/```  #本地库文件搜索路径\r\n## 编译\r\n```\r\nxmake\r\nxmake run VIMAG 或者 xmake run VIMAG image-path/dist\r\n```\r\n\r\n\r\n\r\n\r\n# VIMAG\r\n\r\n\r\n## Vimag格式支持\r\n   - 支持多种图像格式（JPG/JPEG/PNG/BMP/GIF/TGA/HDR/PSD）\r\n## 快捷键\r\n[鼠标]/[键盘]\r\n- 滚轮：缩放\r\n- 左键拖拽：移动\r\n- 左键双击：重置移动和缩放\r\n- 左键单击+滚轮||左右方向键：切换图片\r\n- 中键||\"F\"：窗口最大化/最小化\r\n- 右键单击：打开设置面板\r\n- 鼠标移入窗口上边缘：显示标题栏\r\n\r\n- **预览**：选中图片后，空格预览/关闭预览图像(仅支持windows)(需要启用Vimag_hook)\r\n[windows Vimag_hook]\r\nwindows 运行dist/Vimag_hook 可以启用预览钩子,\r\n**Vimag_hook需要和Vimag放在同一目录下**\r\n资源浏览器里面选中所支持的图像格式点击**空格**可以预览图像\r\n- 托盘可以配置\r\n    - 启用/禁止\r\n    - 开始/暂停\r\n    - 开机自启\r\n    - 开启/关闭控制台(仅供简单调试使用)\r\n\r\n## 项目结构\r\n\r\n```\r\nUI/\r\n├── src/\r\n│   ├── animation       # 动画类\r\n│   ├── component       # 组件类\r\n│   ├── TinyEXIF        # EXIF\r\n│   ├── third_party     # 库\r\n│   ├── utils           # 工具函数\r\n│   ├── font            # 字体类\r\n│   ├── icon            # 图像资源\r\n│   ├── UIWindow.h      # UIWindow 类头文件\r\n│   ├── UIWindow.cpp    # UIWindow 类实现\r\n│   └── Vimag.cpp       # Vimag 程序\r\n├── xmake.lua           # 构建配置\r\n└── README.md           # 项目说明\r\n```\r\n\r\n\r\n## 依赖库\r\n\r\n- **GLFW 3.3.8**: 窗口管理和输入处理\r\n- **GLEW 1.13.0**: OpenGL 扩展加载\r\n- **NanoVG**: 2D 矢量图形渲染\r\n\r\n\r\n# UI 框架\r\n\r\n基于 GLFW、OpenGL 和 NanoVG 开发的 UI 窗口项目,。\r\n## 特性\r\n\r\n- ✅ 跨平台支持（Windows/Linux）\r\n- ✅ Opengl渲染\r\n- ✅ 透明窗口支持\r\n- ✅ 事件回调系统\r\n- ✅ 自动资源管理\r\n- ✅ NanoVG 集成\r\n\r\n## UIWindow 类的主要功能\r\n\r\n### 1. 窗口管理\r\n- 创建、初始化、清理GLFW窗口\r\n- 窗口生命周期管理\r\n- 自动资源清理\r\n\r\n### 2. 渲染上下文\r\n- 管理OpenGL和NanoVG上下文\r\n- 自动初始化GLEW\r\n- 提供统一的渲染环境\r\n\r\n### 3. 事件处理\r\n- 封装鼠标、键盘事件处理\r\n- 简化输入状态查询\r\n- 支持光标位置获取\r\n\r\n### 4. 渲染循环\r\n- 提供便捷的渲染开始/结束方法\r\n- 自动处理帧缓冲区管理\r\n- 简化渲染流程\r\n\r\n### 5. 回调系统\r\n- 支持自定义事件回调函数\r\n- 键盘、鼠标、窗口大小变化回调\r\n- 类型安全的回调接口\r\n\r\n### 6. 窗口属性\r\n- 透明度、大小等属性设置\r\n- 透明帧缓冲区支持\r\n- 灵活的窗口配置选项\r\n\r\n\r\n# xmake 代码提示和补全配置\r\n## clangd 配置xmake 代码提示和补全\r\n## clangd安装\r\n(以 VSCode 为例)安装 ​**vscode-clangd**​ 插件（在扩展商店搜索安装）\r\n然后下载安装⏬```https://github.com/llvm/llvm-project/releases``` ,bin路径添加到环境变量\r\n##配置xmake(​核心配置步骤​)\r\n1. 生成 compile_commands.json（编译数据库）​​\r\n\r\n自动更新​：在 xmake.lua 中添加规则：\r\n```lua\r\nadd_rules(\"plugin.compile_commands.autoupdate\", { outputdir = \".vscode\" })\r\n```\r\n手动生成​：在项目根目录执行：\r\n```bash\r\nxmake project -k compile_commands\r\n```\r\n默认生成在项目根目录，可通过 --outputdir=.vscode 指定输出到 .vscode 目录。\r\n每次编译时自动更新该文件。\r\n2.  配置 VS Code 的 Clangd 插件​\r\n在 .vscode/settings.json 中指定编译数据库路径：\r\n\r\n```json\r\n{\r\n  \"clangd.arguments\": [\r\n    \"--compile-commands-dir=${workspaceFolder}/.vscode\",  // 指向 compile_commands.json 所在目录\r\n    \"--header-insertion=never\",                           // 禁止自动插入头文件\r\n    \"--completion-style=detailed\"                         // 启用详细补全提示\r\n  ]\r\n}\r\n```\r\n若文件在根目录，则路径改为 ${workspaceFolder}\r\n\r\n\r\n\r\n## 📊 动态统计\r\n[![Stars](https://img.shields.io/github/stars/fantasywoc/Vimag?label=Stars\u0026color=yellow\u0026logo=github)](https://github.com/fantasywoc/Vimag/stargazers)\r\n[![Forks](https://img.shields.io/github/forks/fantasywoc/Vimag?label=Forks\u0026color=blue\u0026logo=github)](https://github.com/fantasywoc/Vimag/network/members)\r\n[![Downloads](https://img.shields.io/github/downloads/fantasywoc/Vimag/total?label=Downloads)](https://github.com/fantasywoc/Vimag/releases)\r\n\r\n\r\n\r\n\r\n## 许可证\r\n\r\n本项目采用开源许可证，具体请查看 LICENSE 文件。\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasywoc%2Fvimag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffantasywoc%2Fvimag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffantasywoc%2Fvimag/lists"}