本文介绍了对'MarshalByRefObject'类型的引用声称它在'mscorlib'中定义,但无法找到它。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用visual studio 2015开发一个Windows通用应用程序。但是当我尝试在System.drawing.Imaging中使用GetPixel时,我遇到了错误。我找不到解决这个问题的方法。任何人遇到同样的问题并有解决方案吗?

提前致谢!

彩色图像; 
float [,] imagegray = new float [image.Width,image.Height];
for int i = 0 ; i < image.Width; i ++)
{
for int j = 0 ; j < image.Height; j ++)
{
imagecolor = image.GetPixel(i,j);
imagegray [i,j] = 0 .299f * imagecolor.R + 0 .587f * imagecolor.G + 0 .114f * imagecolor.B;
}
}
解决方案

I'm working on a windows universal app with visual studio 2015. But I meet the error when I tried to use GetPixel in System.drawing.Imaging. I can't find the solution for this problem. Anyone has met the same problem and have a solution?
Thanks in advance!

Color imagecolor;
float[,] imagegray = new float[image.Width, image.Height];
for (int i = 0; i < image.Width; i++)
{
    for (int j = 0; j < image.Height; j++)
    {
        imagecolor = image.GetPixel(i, j);
        imagegray[i, j] = 0.299f * imagecolor.R + 0.587f * imagecolor.G + 0.114f * imagecolor.B;
    }
}
解决方案


这篇关于对'MarshalByRefObject'类型的引用声称它在'mscorlib'中定义,但无法找到它。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 16:09