简体   繁体   English

.NET相当于Java的MemoryImageSource

[英].NET's equivalent of Java's MemoryImageSource

I found a wonderful open source Java program that I'm translating into C#. 我找到了一个很棒的开源Java程序,可以将其转换为C#。 The built-in translator in Visual Studio got me started and I've now spent about a month translating the rest manually line by line. Visual Studio中的内置翻译器使我开始工作,现在我花了大约一个月的时间逐行手动翻译其余部分。 I've completed over 15,000 lines of translation and the only thing that remains is trying to figure out how to convert their MemoryImageSource stuff into C#/.NET. 我已经完成了超过15,000行的翻译,剩下的唯一一件事就是试图弄清楚如何将其MemoryImageSource内容转换为C#/。NET。

What's the .NET equivalent way of implementing this stuff? .NET的等效实现方式是什么? Is there a native .NET library already? 已经有本机.NET库了吗?

The standard .NET System.Drawing. 标准.NET System.Drawing. Bitmap class in the System.Drawing.dll assembly comes close to what I know of the MemoryImageSource (ie, an image represented as an array of pixels that you can manipulate). System.Drawing.dll程序集中的Bitmap类与我对MemoryImageSource了解非常接近(即,表示为可以操纵的像素数组的图像)。

For better performance, you can use the ImageTraverser class from CodeProject, which accessses the array through unmanaged pointers. 为了获得更好的性能,可以使用CodeProject中的ImageTraverser类,该类通过非托管指针访问数组。

Look at the System.Drawing namespace. 查看System.Drawing命名空间。 This wraps the standard windows GDI+ native code. 这将包装标准的Windows GDI +本机代码。

System.Drawing.BitMap is probably what you want. System.Drawing.BitMap可能就是您想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM