Link to home
Start Free TrialLog in
Avatar of muskad202
muskad202

asked on

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
Avatar of muskad202
muskad202

ASKER

even creating a JPEG/GIF from scratch would do .. but I think this might be much more complicated ..
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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"));
thanks :)