我正在尝试将 Java 程序转换为 C#,但我不知道 BufferedImage 从 Java 到 C# 的等价物...
来自 Java 的代码:
public static String ActiveContour(int x11, int x22, int y11, int y22, BufferedImage bufIm, int contor)
{
double [][] img=new double[bufIm.getHeight()][bufIm.getWidth()];
double [][] imgf=new double[bufIm.getHeight()][bufIm.getWidth()];
w=bufIm.getWidth();
h=bufIm.getHeight();
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
{
img[i][j]=bufIm.getRGB(j, i);
c = new Color((int)img[i][j]);
img[i][j]= 0.2898*c.getRed() + 0.5870*c.getGreen() + 0.1140*c.getBlue();
}
我是否遗漏了一个声明?
using System...;
因为在Java中我有
import java.awt.image.BufferedImage;
最佳答案
System.Drawing.Bitmap
是我能想到的最接近的。
关于c# - BufferedImage 从 Java 到 C# 的等价物,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4776939/