• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Drawing Images problem

 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, here is my problem:
I have a signed applet that loads images (lots of), build a canvas that contains each one and throw them in a container. All the images are loaded pretty well but the creation of the canvas takes too long. Sometimes only a few are loaded and then the applet hangs. If I open the Java Console he (the applet) will be active again, load a few more canvas (with image inside) and then hangs. If I press "T" (to show the threads) he will load some more ... This behavior depends on what?
Why can I load images in seconds and a poor canvas takes so long?
If anyone encountered this type of problem, please reply.
Thank you for your attention,
Ady
[This message has been edited by Adrian Muscalu (edited August 02, 2000).]
 
Herbert Maosa
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adrian,
May I ask how you are able to isolate that it is the rendering of the canvas and not the loading of the lots of images that is yielding this behaviour ? IMO I would suspect that it could be the loading of the images themselves, if you had not said you are pretty sure it is the canvas. I know applets have the tendency to start displaying images before they are fully loaded.Whatever the cause of your situation, may I suggest, if you have not already done so, to use mediatracker to ensure that ALL the images are loaded before the system attempts to display any one of them or to render the canvas...
Herbert.
 
Adrian Muscalu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reply, Herbert. I load images in "for" statement and I receive a "System.out.println" after each image has been loaded. After all this images are loaded, there is another "for" statement that creates instaces of the class that contains images (extends canvs). That's the way I figured out that not the images loading cause problems (I use MediaTracker anyway). There is still a strange fact that the creating canvases process seems to be unlocked by an "signal" send by JavaConsole window. Isnt't it strange? The class that contains the image (extends canvas) have a lot of String variables, one thread, a few int and double... May be an issue of overloading? I guess not.
Regards,
Ady
 
Herbert Maosa
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it is really strange. I am failing to figure out what this could be.....If you have adequate system resources for all the objects you are creating, the threads, the lots of images, then should have some behaviour with acceptable stability.
I have a funny idea,....why dont you try creating the canvas instances, without the images and see if there is a change in behaviour.......Just last kicks of dying horse
Herbert
 
paul wheaton
Trailboss
Pie
Posts: 21596
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to the applets forum ...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic