Piddling with the image

This page is currently putting up with massive transmutation and that is precisely why only the lonely code will have to make do. We will be back here soon, but till then, Thanx for visiting this page. If you are a member of the Java-crazed community, you can still try out the code furnished here. Maybe with some divine intervention you might be able to get the drift...


a1.html

<applet code="zzz" width=350 height=300></applet>

zzz.java programs

The import statements for all the programs

import java.applet.*;
import java.awt.*;
import java.awt.image.*;
Program 1
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {       g.drawImage(o,0,0,this);
        }
}
Program 2
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {       g.drawImage(o,0,0,this);
        }
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f);
                return true;
        }
}
Program 3
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f);
                return false;
        }
Program 4
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {
        }
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f);
                return true;
        }
}
Program 5
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {       g.drawImage(o,0,0,this);
        }
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f);
                Graphics h;
                h=getGraphics();
                h.drawImage(m,150,150,this);
                return true;
        }
}
Program 6
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {       g.drawImage(o,0,0,this);
        }
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       System.out.println("x="+x+" y="+y+" w="+w+" h="+h+" flags="+f);
                Graphics h;
                h=getGraphics();
                h.drawImage(m,150,150,this);
                repaint(3000);
                return true;
        }
}
Program 7
public class zzz extends Applet
{       Image o;
        public void init()
        {       o=getImage(getDocumentBase(),"joe.surf.yellow.small.gif");
        }
        public void paint(Graphics g)
        {       g.drawImage(o,0,0,this);
        }
        public boolean mouseDown(Event e,int x,int y)
        {       repaint();
                return true;
        }
        public boolean imageUpdate(Image m, int f,int x, int y, int w,int h)
        {       return true;
        }
}


After all that piddling, get to the next topic "Some sludge about images" or just mail your comments, feedback, suggestions et al to us.

Back to our Java page


Vijay Mukhi's Computer Institute
B-13, Everest Building, Tardeo, Bombay 400 034, India.
http://www.neca.com/~vmis
e-mail : vmukhi@giasbm01.vsnl.net.in
1