Bitmap image

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
edeferaxy
New poster
Posts: 2
Joined: Fri Jan 20, 2012 8:23 am

Bitmap image

Post by edeferaxy »

How do you make a Bitmap image a JPEG image? And can you do this using a photo in a normal windows folder? All of my pictures use the JPEG image symbol, however some use the paint symbol (Bitmap). Can I convert them to JPEG format?
_______________________________
keyword research ~ keyword tool ~ keyword tracking ~ affiliate elite
Last edited by edeferaxy on Fri Jul 27, 2012 11:54 am, edited 1 time in total.
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Bitmap image

Post by brianfry713 »

In MS Paint you can convert a BMP to a JPEG.
Check input and AC output for thousands of problems on uDebug!
massonmilo
New poster
Posts: 1
Joined: Mon Dec 29, 2014 12:08 pm

Re: Bitmap image

Post by massonmilo »

As for image conversion between Bitmap and JPEG images is of course can be achieved. Here is the code which i am using
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
public class ConvertJPGToBMP
{
public static void main(String a[]){
try{
System.out.println("Enter image name\n");
BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
String imageName=bf.readLine();
File input = new File(imageName);
BufferedImage image = ImageIO.read(input);
System.out.println("Enter the output image name(.bmp):\n");
String imageName1=bf.readLine();
File output = new File(imageName1);
ImageIO.write(image, "bmp", output);
System.out.println("Your image has been converted successfully");
}catch(FileNotFoundException e){
System.out.println("Error:"+e.getMessage());
}catch(IOException e)
{
System.out.println("Error:"+e.getMessage());
}
catch(Exception e){
System.out.println(e.getMessage());
}
}
}

See also: Convert Image, Image Conversion Solution
Post Reply

Return to “C++”