Please visit our sponsors.
Click Here to Visit our Sponsor

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;
        }
}


Make your own free website on Tripod.com