Giving Leonardo the goosies

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 faster than a Somalian with a free lunch voucher, 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 commands for all the following programs will be

import java.awt.*;
import java.awt.image.*;
import java.applet.Applet;
Program 1
public class zzz extends Applet
{       Image c;
        int a[] = new int[100 * 100];
        public void init ()
        {       int n = 0;
                ImageProducer p;
                for (int i = 0; i < 100 ; i++)
                for ( int j = 0; j < 100 ; j++)
                        a[n++]=0xffff0000;
                p = new MemoryImageSource(100,100,a,0,100);
                c = createImage(p);
        }
        public void paint(Graphics g)
        {       g.drawImage(c,0,0,this);    
        }
}
Program 2
public class zzz extends Applet
{       Image c;
        int a[] = new int[10000];
        public void init ()
        {       int n = 0;
                ImageProducer p;
                for (int i = 0; i < 5000 ; i++)
                        a[n++]=0xffff0000;
                for ( int j = 0; j < 5000 ; j++)
                        a[n++]=0x0000ff00;
                p = new MemoryImageSource(100,100,a,0,100);
                c = createImage(p);
        }
        public void paint(Graphics g)
        {       g.drawImage(c,0,0,this);    
        }
}
Program 3
public class zzz extends Applet
{       Image c;
        int a[] = new int[10000];
        public void init ()
        {       int n = 0;
                ImageProducer p;
                for (int i = 0; i < 10000 ; i++)
                a[n++]=0xffff0000;
                p = new MemoryImageSource(100,100,a,0,100);
                c = createImage(p);
        }
        public void paint(Graphics g)
        {       g.drawImage(c,0,0,this);    
        }
        public boolean mouseDown(Event e,int x,int y)
        {       int n = 0;
                ImageProducer q;
                for (int i = 0; i < 10000 ; i++)
                        a[n++] = 0x0fff0000;
                q = new MemoryImageSource(100,100,a,0,100);
                c = createImage(q);
                repaint();
                return true;
        }
}
Program 4
public class zzz extends Applet
{       Image c;int k = 0;
        int a[] = new int[10000];
        public void init ()
        {       int n = 0;
                ImageProducer p;
                for (int i = 0; i < 10000 ; i++)
                        a[n++]=0x00ff0000;
                        p = new MemoryImageSource(100, 100, a, 0, 100);
                c = createImage(p);
        }
        public void paint(Graphics g)
        {       g.drawImage(c,0,0,this);    
        }
        public boolean mouseDown(Event e,int x,int y)
        {       k=k+10;
                int n = 0;
                ImageProducer q;
                for (int i = 0; i < 10000 ; i++)
                        a[n++] = 0x00ff0000 | (k<<24);
                q = new MemoryImageSource(100, 100, a, 0, 100);
                c = createImage(q);
                repaint();
                showStatus("Value of k " + k);
                return true;
        }
}
Program 5
public class zzz extends Applet
{       Image c;int k = 0;
        int a[] = new int[10000];
        ImageProducer p;
        public void init ()
        {       int n = 0;
                for (int i = 0; i < 10000 ; i++)
                        a[n++]=0xffff0000;
                p = new MemoryImageSource(100, 100, a, 0, 100);
                c = createImage(p);
        }
        public void paint(Graphics g)
        {       g.drawImage(c,0,0,this);    
        }
        public boolean mouseDown(Event e,int x,int y)
        {       k=k+10;
                int n = 0;
                ImageProducer q;
                for (int i = 0; i < 10000 ; i++)
                        a[n++] = 0xff000000 | (k<<16);
                q = new MemoryImageSource(100, 100, a, 0, 100);
                c = createImage(q);
                repaint();
                showStatus("Value of k " + k);
                return true;
        }
}


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