c# - 在 Windows 应用商店应用程序中组合位图图像的最简单方法是什么

标签 c# c++ bitmap windows-runtime windows-store-apps

我正在尝试开发一个 Windows 应用商店应用程序,它生成并保存由各种图像、原始形状和文本组成的位图图像。我不一定希望所有图像都显示在屏幕上,因为我可能需要生成很 multimap 像。我的应用程序是用 C# 编写的。我看到 Microsoft 在 Windows 8.1 中引入了一个新的 RenderTargetBitmap 类——我打算将其定位——但它只保存屏幕上的 XAML 树。是我使用 C++ 的唯一选择吗?如果是,哪个 C++ 库是免费的、与 WinRT 兼容并具有简单的 API?

最佳答案

看看WriteableBitmap .它允许您在图像中手动绘制像素,方法是首先将它们写入字节数组。

如果您需要其他工具来渲染形状等,WriteableBitmapEx可以是一个不错的选择。从链接引用:

The WriteableBitmap API is very minimalistic and there's only the raw Pixels array for such operations. The WriteableBitmapEx library tries to compensate that with extensions methods that are easy to use like built in methods and offer GDI+ like functionality. The library extends the WriteableBitmap class with elementary and fast (2D drawing) functionality, conversion methods and functions to combine (blit) WriteableBitmaps.

关于c# - 在 Windows 应用商店应用程序中组合位图图像的最简单方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18432637/

相关文章:

C#:泛型方法的 Func<T, TResult>

c# - 如何向记录的主构造函数添加属性?

C++:自定义删除器状态

Android 颜色格式(RGB565、ARGB8888)

c# - app.config 中的自定义部分在 C# 中抛出错误

c# - 如何创建多个列表作为数组?

c++ - boost.Asio 的 "ssl"实现是否存在数据竞争?

c++ - C++ 中的额外限定错误

c - bmp 图像到 c 中的矩阵(二维数组)

bitmap - EaselJS:有问题的拖/放