creating a .bmp file from scratch

hi !!

in my app, i need to create a bitmap file from scratch (i.e, i will specify the width, height of the image, and the RGB values of each pixel).

can anyone help :)

thanks :)
muskad202
LVL 2
muskad202Asked:
Who is Participating?
 
muskad202Author Commented:
even creating a JPEG/GIF from scratch would do .. but I think this might be much more complicated ..
0
 
CEHJCommented:
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(width, height, BufferedImage.INT_RGB);
// draw on it, then
javax.imageio.ImageIO.write(image, "JPEG", new File("x.jpg"));
0
 
muskad202Author Commented:
thanks :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.