We Recommend

Java How to Program Java How to Program
Takes a new tools-based approach to Web application development that uses Netbeans 5.5 and Java Studio Creator 2 to create and consume Web Services. Features new AJAX-enabled, Web applications built with JavaServer Faces (JSF), Java Studio Creator 2 and the Java Blueprints AJAX Components. Includes new topics throughout, such as JDBC 4, SwingWorker for multithreaded GUIs, GroupLayout, Java Desktop Integration Components (JDIC), and much more.


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.