J
jimgardener
hi,
if I want to create a BufferedImage of certain width and height from
a given array of pixel data,how should I check for the array size?
should it be like data.length == width* height ? or should I check
data.length == 3 * width* height ?
Below is the code snippet where I would like to check the pixel data
array size.
public class ImageCreateUtil {
public BufferedImage createImage (int w , int h ,double[] data){
BufferedImage myImage=new BufferedImage(w, h,
BufferedImage.TYPE_INT_RGB);
myImage.getRaster().setPixels(0, 0, w, h, data);
return myImage;
}
....
}
thanks in advance,
jim
if I want to create a BufferedImage of certain width and height from
a given array of pixel data,how should I check for the array size?
should it be like data.length == width* height ? or should I check
data.length == 3 * width* height ?
Below is the code snippet where I would like to check the pixel data
array size.
public class ImageCreateUtil {
public BufferedImage createImage (int w , int h ,double[] data){
BufferedImage myImage=new BufferedImage(w, h,
BufferedImage.TYPE_INT_RGB);
myImage.getRaster().setPixels(0, 0, w, h, data);
return myImage;
}
....
}
thanks in advance,
jim