import java.awt.image.*; import java.awt.geom.*; import java.awt.*; import java.applet.*; public class Pildiskaleerimine1 extends Applet{ BufferedImage pilt1=new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); BufferedImage pilt2=new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); public Pildiskaleerimine1(){ Graphics g=pilt1.createGraphics(); g.setColor(Color.green); g.fillOval(10, 10, 80, 80); g.setColor(Color.blue); g.fillOval(10, 10, 20, 20); g.setColor(Color.red); g.fillOval(70, 70, 20, 20); RescaleOp rop = new RescaleOp(0.1f, 200.0f, null); //väärtus*0.1 + 200 rop.filter(pilt1,pilt2); } public void paint(Graphics g){ g.drawImage(pilt1, 25, 50, this); g.drawImage(pilt2, 175, 50, this); } public static void main(String argumendid[]){ Frame f=new Frame("Pildi värvide muutmine"); f.add(new Pildiskaleerimine1()); f.setSize(300, 200); f.setVisible(true); } }