You are here: DEVPPL Forum Programming Java Forum
NOTIFICATIONS
54.099
MEMBERS
15.693
TOPICS
62.271
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

resize image in Java

0

Loading

resize image in Java

Postby RedLay » Mon Mar 01, 2010 10:11 pm

Hi,

I can load image but i don't know how can i resize image?
My class to load image:

Code: Select all
public void WczytajObrazek(String path)
{
        File flPlik=  new File(path);
        imgObrazek=   new BufferedImage(10,10, BufferedImage.TYPE_INT_RGB);
        try
                {
                imgObrazek=ImageIO.read(flPlik);
                }
                catch(IOException e)
                        {
                        System.out.println(e.getMessage());
                        }
}

my thread is in forum CentOS
RedLay
 
Reputation: 0
Posts: 1
Joined: Mon Mar 01, 2010 10:05 pm
Highscores: 0
Arcade winning challenges: 0

resize image in Java - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: resize image in Java

Postby Coman Doru » Sat Mar 23, 2013 8:23 pm

BufferedImage resizedImage = new BufferedImage(IMG_WIDTH, IMG_HEIGHT, type);
Graphics2D g = resizedImage.createGraphics();
g.drawImage(originalImage, 0, 0, IMG_WIDTH, IMG_HEIGHT, null);
g.dispose();
Coman Doru
 
Reputation: 0
Posts: 2
Joined: Sat Mar 23, 2013 8:09 pm
Highscores: 0
Arcade winning challenges: 0
0

Loading

Re: resize image in Java

Postby Sdfghu Sdfghu » Mon Mar 25, 2013 9:00 am

java :roll: difficult
Sdfghu Sdfghu
 
Reputation: 0
Posts: 6
Joined: Sat Mar 23, 2013 9:09 am
Highscores: 0
Arcade winning challenges: 0
^ Back to Top