Posted By

whitetiger on 11/09/06


Tagged

image jpg java rotate filter images Converter RGB j2me gray flip half zoom


Versions (?)

Java - ZoomIN Image


 / Published in: Java
 

  1. public BufferedImage zoomIn(BufferedImage bi, int scale)
  2. {
  3. int width = scale * bi.getWidth();
  4. int height = scale * bi.getHeight();
  5.  
  6. BufferedImage biScale = new BufferedImage(width, height, bi.getType());
  7.  
  8. // Cicla dando un valore medio al pixel corrispondente
  9. for(int i=0; i<width; i++)
  10. for(int j=0; j<height; j++)
  11. biScale.setRGB(i, j, bi.getRGB(i/scale, j/scale));
  12.  
  13. return biScale;
  14. }

Report this snippet  

You need to login to post a comment.