我应该使用 .net 中的哪个图像类来使库尽可能更通用?
我正在构建一个库,我希望它尽可能通用。具体来说,我希望它能够在 Winform 和 WPF 上运行(顺便说一句,WPF 更重要)。
该图像类必须支持 4 字节颜色 (ARGB),因为我必须将其转换为 QVGA 格式(由我的 G19 键盘的 LG 屏幕使用)。如果它支持qvga格式,那就更好了。
如果它本身不支持 QVGA,则它必须支持“快速”操作以将其复制(每个字节)到 320x240x4 的数组,显然我会按正确的顺序重新组织字节。
所以到目前为止,我在 C# 中使用过的唯一图像类是 Bitmap,并且到目前为止它是有效的。但是我不认为 WPF 中使用了该类。
我应该用什么来支持,如果不是同时支持WPF和winform,至少是WPF(我认为更重要)。
谢谢
I'm building a library that I would like to make it as generic as possible. Specifically, I would like that it will work both on Winform and WPF (ok WPF is more important by the way).
This image class must support 4 byte colors (ARGB) because I must convert it in QVGA format (is used by Lg screen of my G19 keyboard). if it supports qvga format, this is always better.
If it doesn't support QVGA natively, it must support "fast" operations to copy it (byte per byte) to an array of 320x240x4 where obviusly I'll reorganize bytes in correct order.
So the only image class I've used so far from C# is Bitmap, and it worked so far. However I don't think that class is used in WPF.
What should I use to support, if not both WPF and winforms, at least WPF (I think it's more important).
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WPF 支持和使用
Bitmap
和Image
类。请毫不犹豫地使用它们并将您的类库建立在它们的基础上。如果您想要一个可以在 WPF、WinForms、ASP.NET、Silverlight、控制台应用程序中工作的通用图像处理库,那么这正是您需要的类。The
Bitmap
andImage
classes are supported and used in WPF. Don't hesitate to use them and base your class library on them. If you want to have a generic image manipulation library that would work in WPF, WinForms, ASP.NET, Silverlight, Console applications, that's exactly the kind of classes that you need.