I am trying to convert a Java program to C# and I don't know the equivalent of BufferedImage from Java to C#...
Code from 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();
}
Am I missing a statement?
using System...;
because in Java I have
import java.awt.image.BufferedImage;
System.Drawing.Bitmap
is the closest I can think of.
What does this function do? Why bother with translating the code bit by bit when most probably there is another way achieving the same result using C# classes? In C# using System.Drawing.Bitmap is common practice but there are other ways depending on what the code is meant to be doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With