I need to be able to add to a greenfootImage that has been read from a file. It has already been edited, so I cannot set the image again or the previous image is lost. I have a file, another file is put into this and it changes, then i need the user to be able to change the origial file while the primary changes are kept, can anyone help, see code below
Regards,
The silkiest team on the greenfoot scene
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | if (Greenfoot.mouseClicked(l2)) { String Label1 = ReadasString(); String text21 = ReadasString2(); GreenfootImage imageprint12 = new GreenfootImage (text21, 25 , Color.BLACK, Color.ORANGE); l2.setImage(imageprint12); String[] partsa = text21.split( "," ); String myleetstring=Label.replace( "#" , "A" ) .replace( "*" , "M" ) .replace( "%" , "N" ); GreenfootImage imagee = new GreenfootImage ( "" +myleetstring, 25 , Color.BLACK, Color.ORANGE); l1.setImage(imagee); } String Labela = ReadasString2(); String[] partsa = Label.split( "\n" ); String alla = partsa[ 0 ] + partsa[ 1 ] + partsa[ 2 ] + partsa[ 3 ]; GreenfootImage textImageA = new GreenfootImage (Labela, 25 , Color.BLACK, Color.ORANGE); if (Greenfoot.mouseClicked(l3)) { String mystring1 = JOptionPane.showInputDialog( "Enter a symbol to be replaced" ); String mystring2 = JOptionPane.showInputDialog( "Enter a letter as replacement" ); String myleetstring=Label.replace( "" +mystring1, "" +mystring2); GreenfootImage imageeno = new GreenfootImage ( "" +myleetstring, 25 , Color.BLACK, Color.ORANGE); l1.setImage(imageeno); } |