import java.awt.*; import java.awt.image.*; public class abitahvel extends Canvas{ int vx, vy, ux, uy, ax, ay, px, py, laius, korgus; int op=1; Image pilt, sahver, puhver; Image summa, integraal; String lause=" "; Graphics piltg, sahverg, puhverg; Color maluvarv=Color.black; boolean margitud=false, pilt_olemas=false; abitahvel(int w, int h){ // resize(w, h); this.reshape(0, 0, w, h); laius=w; korgus=h; setBackground(Color.white); } public boolean imageUpdate( Image image, int f, int x0, int y0, int xe, int ye){ if ((f & ImageObserver.ALLBITS) != 0){pilt_olemas=true; System.out.println("pilt juures"); } System.out.println("Pildivaatleja"); return true;} public void paint(Graphics g){ if (pilt==null){ pilt=createImage(size().width, size().height); piltg=pilt.getGraphics(); piltg.setColor(Color.black); sahver=createImage(size().width, size().height); sahverg=sahver.getGraphics(); } g.drawImage(pilt, 0, 0, null); } public String kokku(String s){ char tahed1[]; char tahed2[]=new char[laius*korgus]; char c; int i, koht1, koht2, arv; String abi; tahed1=s.toCharArray(); koht1=0; koht2=0; while(koht1s.length()-1)break; } abi=String.valueOf(arv); for (int ik=0; ik> 16) & 0xff; if (((pixels[j * laius + i] >> 16) & 0xff)==0){c[ik++]='m';} else if ((((pixels[j * laius + i] >> 16) & 0xff)==255)&& (((pixels[j * laius + i] >> 8) & 0xff)==255)){c[ik++]='v';} else if ((((pixels[j * laius + i] >> 16) & 0xff)==255)&& (((pixels[j * laius + i] >> 8) & 0xff)==0)){c[ik++]='p';} else {c[ik++]='k';} } } s=new String(c); return kokku(s); } public void stringipilt(String s){ Image abi; int[] pixels = new int[laius*korgus]; char c[]=new char[laius*korgus]; int i, p; s=lahti(s); c=s.toCharArray(); p=s.length(); for(i=0; i