private BitmapData CreateLighterShadesOfGray(BitmapData pixelData)
{
Int32 depth;
Int32 loThreashold = 0;
Int32 hiThreshold = 3500;
short[] enhPixelData = new short[pixelData.Width * pixelData.Height];
for (int i = 0; i < pixelData.Height*pixelData.Width; i++)
{
depth = pixelData[i] >> DepthImageFrame.PlayerIndexBitmaskWidth;
if (depth < loThreashold || depth > hiThreshold)
{
enhPixelData[i] = 0xFF;
}
else
{
enhPixelData[i] = (short)~pixelData[i];
}
}
var a = new BitmapData();
a.Scan0 = (IntPtr)enhPixelData.ToArray().SyncRoot;
return a;
}
这段程序中的 pixelData[i]报错严重性: CS0021 Cannot apply indexing with [] to an expression of type 'BitmapData‘
本人小白,求各位大神解答
{
Int32 depth;
Int32 loThreashold = 0;
Int32 hiThreshold = 3500;
short[] enhPixelData = new short[pixelData.Width * pixelData.Height];
for (int i = 0; i < pixelData.Height*pixelData.Width; i++)
{
depth = pixelData[i] >> DepthImageFrame.PlayerIndexBitmaskWidth;
if (depth < loThreashold || depth > hiThreshold)
{
enhPixelData[i] = 0xFF;
}
else
{
enhPixelData[i] = (short)~pixelData[i];
}
}
var a = new BitmapData();
a.Scan0 = (IntPtr)enhPixelData.ToArray().SyncRoot;
return a;
}
这段程序中的 pixelData[i]报错严重性: CS0021 Cannot apply indexing with [] to an expression of type 'BitmapData‘
本人小白,求各位大神解答
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货