dcsimg
Why applet images load slowly?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Leo_Ge
Posted On:   Tuesday, August 4, 2009 07:36 AM

Hello! I wrote an applet to load & draw images: ... void myDraw () { for (int x = 0; x < 3; x++) for (int y = 0; y < 3; y++) _images [x][y] = getImage (getDocumentBase (), new String ("") + x + "_" + y + ".jpg"); } public void paint (Graphics graphics) { for (int x = 0; x < 3; x++) for (int y = 0; y < 3; y++) graphics.drawImage (_images[x][y], ..., this); } I notices that to the applet it takes much more time to download & draw the picture, than to HTML: " <"i   More>>

Hello!

I wrote an applet to load & draw images:




...

void myDraw ()
{
for (int x = 0; x < 3; x++)
for (int y = 0; y < 3; y++)
_images [x][y] = getImage (getDocumentBase (), new String ("") + x + "_" + y + ".jpg");
}





public void paint (Graphics graphics)
{
for (int x = 0; x < 3; x++)
for (int y = 0; y < 3; y++)
graphics.drawImage (_images[x][y], ..., this);
}





I notices that to the applet it takes much more time to download & draw the picture, than to HTML:





" <"img src=0_0.jpg">"
" <"img src=1_0.jpg">"
" <"img src=2_0.jpg">"
" <"br">"
" <"img src=0_1.jpg">"
" <"img src=1_1.jpg">"
" <"img src=2_1.jpg">"




This html code loads all images almost instantly, while the same operation in applet (after the applet itself is already loaded) takes much more time.




What could be the resons of it?

   <<Less
About | Sitemap | Contact