> Hei!
Hei!
> Im tryin to make a random screen with MemoryImageSource but faling to do
> it..
[quoted text clipped - 40 lines]
> for (int cc=0; cc< 640*480; ++cc )
> pix [cc]=(int)(Math.random ()*255);
There is a problem with your pixel values. They are always in the range
0x00000000 ... 0x000000FF.
Because you are implicitly using the default RGBColorModel this means:
The blue component varies. The red, green, and -most importantly- the alpha
components are 0.
Hence your image is totally transparent!
Use for example instead:
pix [cc]=0xFF000000 + (int)(Math.random ()*255);
This will give a blue/black sparkling image.
> ImageProducer ip = new MemoryImageSource ( 640,480,pix,0,640 );
> image = createImage (ip);
Here you should call:
repaint();
so that your paint method gets called after your image changed.
Also: Consider making a pause here in order to lower the CPU-load:
try { Thread.sleep(1000); }
catch(InterruptedException e) {}
> }
> }
[quoted text clipped - 10 lines]
> }
>

Signature
"TFritsch$t-online:de".replace(':','.').replace('$','@')