Theatronics wrote:p.s.
Example of some Java I am trying to change to .. something else.
// Grab a pixel from an image.
public int[] getRGB( BufferedImage image, int x, int y, int width, int height, int[] pixels ) {
int type = image.getType();
if ( type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB )
return (int [])image.getRaster().getDataElements( x, y, width, height, pixels );
return image.getRGB( x, y, width, height, pixels, 0, width );
}
In C#:
Image.GetPixel (int x, int y)
Theatronics wrote:
//Change a pixel in an image.
public void setRGB( BufferedImage image, int x, int y, int width, int height, int[] pixels ) {
int type = image.getType();
if ( type == BufferedImage.TYPE_INT_ARGB || type == BufferedImage.TYPE_INT_RGB )
image.getRaster().setDataElements( x, y, width, height, pixels );
else
image.setRGB( x, y, width, height, pixels, 0, width );
}
In C#:
Image.SetPixel (int x, int y, Color color)
BTW: The java-code is bugged because there are other possible types than argb and rgb