Tag: stride

可以从int 数组中获取IntPtr吗?

问候。 在C#中:如果我有一个像这样声明的int []数组 int[] array = new array[size]; 有一种方法可以从这个数组中获取IntPtr吗? 问题是我正在使用EmguCV框架,并且有一个构造函数来创建一个图像,它将IntPtr带到像素数据,以便从数组(int [])构建图像。 Image result = new Image(bitmap.Width,bitmap.Height,stride,”**array.toPointer??**”); 顺便说一句,如果有人能告诉我如何计算步幅,这将是伟大的。

c#scan0和stride

任何人都知道Scan0和Stride的用途? 我需要一个很好的解释谢谢。

为什么BitmapSource.Create会抛出ArgumentException?

我试图通过使用Image和BitmapSource从WPF中显示原始数据创建的位图: Int32[] data = new Int32[RenderHeight * RenderWidth]; for (Int32 i = 0; i < RenderHeight; i++) { for (Int32 j = 0; j < RenderWidth; j++) { Int32 index = j + (i * RenderHeight); if (i + j % 2 == 0) data[index] = 0xFF0000; else data[index] = 0x00FF00; } } BitmapSource source […]