有什么好的 C++用于显示大位图的库
我目前正在使用 MFC/GDI 和 Stingray 在我的应用程序中显示位图,并正在寻找更好的解决方案。具体来说;
- 更快的绘图速度 - 我当前的解决方案很慢,基于 StretchDIBits
- 更好的渲染质量 - 缩放位图时 StretchDIBits 渲染质量很糟糕
- 支持旋转位图
- 支持以所有流行格式加载/保存
- 支持大型位图 - 我经常使用航空照片尺寸为 12,000x12,000 jpeg,大小约为 64mb。 GeoTIFF 支持也很有用
- 与 MFC 文档/视图兼容,包括打印(例如必须能够渲染到 CDC)
- 访问源代码很好,但不是必需的
- 易于使用/移植现有的 GDI 代码
虽然免费总是好的,但我不这么认为不介意花费合理的金额购买一个像样的库,尽管没有运行时版税成本。谷歌搜索建议如下;
任何有经验的人这些或者可以推荐一个好的替代方案吗?
I'm currently using MFC/GDI and Stingray to display bitmaps in my application and am looking for a better solution. Specifically;
- Faster drawing speed - My current solution is slow, based on StretchDIBits
- Better rendering quality - StretchDIBits rendering quality is awful when scaling a bitmap
- Support for rotated bitmaps
- Support for loading / saving in all popular formats
- Support for large bitmaps - I'm regularly using aerial photographs that are ~64mb as 12,000x12,000 jpegs. GeoTIFF support would also be useful
- Compatible with MFC document/view, including printing (e.g. must be able render to a CDC)
- Access to source code is good but not necessary
- Easy to use / port existing GDI code
While free is always nice, I don't mind spending a reasonable amount on a decent library, though no run time royalty costs. Googling suggests the following;
Anyone got experience of these or can recommend an good alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从早期的 XP 开始,GDI+ 可在任何 Windows 计算机上使用。它具有适用于所有流行图像格式的编解码器,其中包括 JPEG。非常好的过滤器,用于高质量图像重新缩放。不受限制的图像旋转。通过 Graphics 类绘制到 CDC。 C++ 包装器的源代码可在 SDK gdiplusXxx.h 头文件中找到。速度可能相当,但是渲染是基于软件的以确保兼容性。
您可以
#include
并直接使用 C++ 包装器。 SDK 文档位于此处。 CImage 类在 MFC 中可用,但它并未公开所有功能。GDI+ is available on any Windows machine since early XP. It has codecs for all popular image formats, JPEG is included. Very nice filters for high-quality image rescaling. Unrestricted image rotation. Draws to a CDC through the Graphics class. Source code for the C++ wrappers are available in the SDK gdiplusXxx.h header files. Speed is likely to be equivalent however, rendering is software based to ensure compatibility.
You can
#include <gdiplus.h>
and use the C++ wrappers directly. The SDK docs are here. The CImage class is available in MFC, it doesn't expose all capabilities however.我认为您不太可能找到比 Windows 上的 GDI 执行速度更快的东西,因为它具有内核级支持,而这是开源解决方案所不具备的。
您可能还想研究 OpenGL 或 Direct2D/Direct3D,因为它们也可以直接访问帧缓冲区。对于 3D API,纹理大小可能会成为一个问题,因为大多数标准限制为 4096x4096 等。
I think it's unlikely you'll find something that performs faster than GDI on windows since it has kernel-level support which is something open source solutions will not have.
You might want to also look into OpenGL or Direct2D/Direct3D since these too have direct access to the frame buffer. With 3D APIs, texture size would probably be an issue since most standards limit to something like 4096x4096.
我过去曾使用过 CxImage ,将其添加到您的评估列表中。
I have used CxImage in the past which is one to add to your evaluation list.