List of usage examples for java.awt.image RescaleOp RescaleOp
public RescaleOp(float scaleFactor, float offset, RenderingHints hints)
From source file:paintbasico2d.VentanaPrincipal.java
private void jSliderBrilloStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderBrilloStateChanged VentanaInterna vi = (VentanaInterna) (escritorio.getSelectedFrame()); if (vi != null) { BufferedImage ImgSource = vi.getLienzo().getImage(); if (img == null) img = ImgSource;//ww w.ja va 2 s.c om if (ImgSource != null) { try { float slider = jSliderBrillo.getValue(); RescaleOp rop = new RescaleOp(1.0F, slider, null); BufferedImage imgdest = rop.filter(this.img, null); vi.getLienzo().setImage(imgdest); vi.getLienzo().repaint(); } catch (IllegalArgumentException e) { System.err.println(e.getLocalizedMessage()); } } } }