You Are Here:

Community: Developer Discussion Boards

#1 Old Speed of Image.createImage - 2004-12-02, 20:28

Join Date: May 2003
Posts: 32
brilleaben
Offline
Registered User
Hi,


What is the speed of Image.createImage? Is it possible to use it in the paint method while still retaining resonable speed?


/brian
Reply With Quote

#2 Old 2004-12-04, 02:17

Join Date: Dec 2004
Posts: 4
raptugava
Offline
Registered User
try to use
System.currentTimeMillis();
to calculate speed of Image.createImage(..)
Reply With Quote

#3 Old 2004-12-04, 10:00

Join Date: May 2003
Posts: 32
brilleaben
Offline
Registered User
Yes - thanks for your suggestion.

Par se, I am not that interested in the actual speed (in time) of Image.createImage.

The situation: I created a small midlet - I designed it while using the Nokia 6230 emulator. In the midlet I preload all graphics (one animation of 10 frames (90 x90 pixels each)) and one "Background" image.
The target device is a Nokia 3100.
While the midlet runs fine on a real Nokia 6230 device it actually refused to run on a 3100.
I found out, that the preloading of the images somehow exhausted the heap/stack/whatever.
So I redesigned the midlet - this time the paint method loads the images and 'nulls' the handle after painting the image. And now it works on a 3100 as well.

My questions, then, are:

Is Image.createImage fast enough to actually be used this way in a game? Ie. where you may have multiple images to draw ..?

/brian
Reply With Quote

#4 Old 2004-12-19, 20:13

Join Date: Jan 2004
Posts: 165
mreaves
Offline
Regular Contributor
It's no surprise you used up all the heap, those images will take around 160k when loaded and on top of the background image you will have just about have exhausted your heap on a low-end series 40 phone.

I doubt you'll be able to use that method usefully in a game as you will more than *likely* have the garbage collector running more often than you really want. Loading up a graphic in this way is slower than pre-loading.

I am just curious as to what application you have that needs 10 frames of that size? On a series 40 phone 90x90 is a fair percentage of the screen. The better method would be to try and optimise the frames.
Reply With Quote

#5 Old 2004-12-20, 08:37

Join Date: May 2003
Posts: 32
brilleaben
Offline
Registered User
Heh - I learned the hard way :-)

I was doing a simple demo application for my girlfriend. The animation contained some flying
hearts.
I did consider breaking up the animation in smaller segments. But due to lack of time, I chose to stick with the loadImage during paint().
It worked out nicely ... (even on a Nokia 3100 :-)

/brian
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ