求教:一段c#代码转换成vb,有一句提示不对,请教该如何改,谢谢!!!
求教:一段c#代码转换成vb,(范例将一幅32位深的图像中所有像素的蓝色分量设为最大(255):)有一句提示不对,请教该如何改,谢谢!!!
下面C#代码用工具转换成VB:运行时Dim row As Pointer(Of Byte)这句提示出错
BitmapData bmd=bm.LockBits(new Rectangle(0, 0, 10, 10), System.Drawing.Imaging.ImageLockMode.ReadOnly, bm.PixelFormat);
int PixelSize=4;
for(int y=0; y<bmd.Height; y++)
{
byte* row=(byte *)bmd.Scan0+(y*bmd.Stride);
for(int x=0; x<bmd.Width; x++)
{
row[x*PixelSize]=255;
}
}
Dim bmd As BitmapData = bm.LockBits(New Rectangle(0, 0, 10, 10), System.Drawing.Imaging.ImageLockMode.[ReadOnly], bm.PixelFormat)
Dim PixelSize As Integer = 4
For y As Integer = 0 To bmd.Height - 1
Dim row As Pointer(Of Byte) = CType(bmd.Scan0, Pointer(Of Byte)) + (y * bmd.Stride)
For x As Integer = 0 To bmd.Width - 1
row(x * PixelSize) = 255
Next
Next