Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/03/2006, 09:41
msi
 
Fecha de Ingreso: marzo-2005
Mensajes: 70
Antigüedad: 19 años, 3 meses
Puntos: 0
Casi lo tengo logrado. De hecho, me funciona trabajando sobre una imagen vacía (Image): OSI = createImage(widthOfOSI,heightOfOSI);

Lo malo es que necesito pintar sobre una plantilla (otra imagen) y ésto sólo lo consigo hacer con BufferedImage.

Creo que el "kit" está en estas 3 líneas:

if (command.equals("Deshacer")){
Image temp = OSI;
OSI = undoBuffer;
undoBuffer = temp;
repaint();
}


Yo intento esto sin éxito:
BufferedImage temp = imageBuffer.getSubimage(0,0,imageBuffer.getWidth() ,imageBuffer.getHeight());
imageBuffer = undoBuffer.getSubimage(0,0,undoBuffer.getWidth(),u ndoBuffer.getHeight());
undoBuffer = temp.getSubimage(0,0,temp.getWidth(),temp.getHeigh t());;


¿Acaso así no se copia la imagen?