Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: Eclaicir une image

 set, stack, swing, awt, JPanel, JFrame
{filelink=10287}

 
import java.awt.image.*;
import java.io.*;
import javax.swing.*;
import javax.imageio.*;
import java.awt.*;
 
 
public class LumiereImage extends JPanel 
 {
  public static void main(String[] argv) throws Exception 
  {
 
    JFrame frame = new JFrame("Affichage d'image taillée en pointe");
    frame.add(new LumiereImage());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400,300);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
 
  }
 
  	  	  public void paint(Graphics g) 
  {
    try 
    	{
 
        BufferedImage monImage = ImageIO.read(new File("c:/image.gif"));    		
    	BufferedImage bufferedImage = new BufferedImage(monImage.getWidth(null), monImage
          .getHeight(null),
      	  BufferedImage.TYPE_BYTE_INDEXED);
 
   		 float scaleFactor = 1.3f;
   		 RescaleOp op = new RescaleOp(scaleFactor, 0, null);
    	 bufferedImage = op.filter(bufferedImage, null);
    	 bufferedImage.getGraphics().drawImage(monImage, 0, 0, null);
 
    } catch (Exception ex) 
    {
      ex.printStackTrace();
    }
  }
}

A Voir sur le même Sujet:

  • image
  • java parcourir jpane document
  • exemple RMI java avec hashmap
  • java format image