You Are Here:

Community: Developer Discussion Boards

#1 Old Image or Sprite, thats the problem - 2007-09-27, 12:34

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
Hi everyone,
I have an application in which I get an Image from a server.
This Image arrives in the form of an Array, which I then use to create the Image itself.
The idea is to use this Image as a background (it may be a picture, or whatever)...
Till now I've been using this Image to create a Sprite, which is then appended onto the LayerManager so as to becom a background...
Now I'd like to know if there are other possibilities ? To begin with : is it necessary to create a Sprite out of this Image ?
Is there a better (less resource-demanding way) of sending an Image from my (perl) server ?

Right now I first have to create an array to store the received data, then I need to create an Image out of it an then create a Sprite... all this is actually pretty memory-demanding... Also for garbage collection, when is the best moment to call it ? after creating the image from the array ? or after creating the sprite ? and if I set the array to null is it possible to reuse it after receiving a new data-array ?

Thanks in advance for any tips, hints and reactions :D
Reply With Quote

#2 Old Re: Image or Sprite, thats the problem - 2007-09-27, 15:37

Join Date: Jun 2007
Posts: 534
Location: Mumbai
Send a message via Yahoo to prakash.raman
prakash.raman's Avatar
prakash.raman
Offline
Super Contributor
Well, seeing ur query i looked into API's well i havent tried this but there is one more way in which case u r not needed to create Sprite out of image... wat u can do is, if u have ur background layer, getGraphics() for that image,then u can set it on background using Layer.paint(Graphics g).

Prakash
Reply With Quote

#3 Old Re: Image or Sprite, thats the problem - 2007-09-28, 13:04

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
hhmm... dont get that....
are u saying to use the paint method instead of a layer ?
or using the paint method and a layer ? cause that would kinda be double work ?
Anyways thanks for taking time to help me ;)
Reply With Quote

#4 Old Re: Image or Sprite, thats the problem - 2007-09-29, 07:39

Join Date: Jul 2007
Posts: 124
Location: Malaysia
tony_ysy
Offline
Regular Contributor
Quote:
Originally Posted by Tiger79 View Post
Hi everyone,
I have an application in which I get an Image from a server.
This Image arrives in the form of an Array, which I then use to create the Image itself.
The idea is to use this Image as a background (it may be a picture, or whatever)...
Till now I've been using this Image to create a Sprite, which is then appended onto the LayerManager so as to becom a background...
Now I'd like to know if there are other possibilities ? To begin with : is it necessary to create a Sprite out of this Image ?
Is there a better (less resource-demanding way) of sending an Image from my (perl) server ?

Right now I first have to create an array to store the received data, then I need to create an Image out of it an then create a Sprite... all this is actually pretty memory-demanding... Also for garbage collection, when is the best moment to call it ? after creating the image from the array ? or after creating the sprite ? and if I set the array to null is it possible to reuse it after receiving a new data-array ?

Thanks in advance for any tips, hints and reactions :D
Hi there,

Download the documentation and source codes from this example SheepDog game:

http://sw.nokia.com/id/748737bb-3d12...de_v2_0_en.zip

Here it explains all you wanted as above.

Have fun and play the game. :)
Reply With Quote

#5 Old Re: Image or Sprite, thats the problem - 2007-09-29, 08:06

Join Date: Jun 2007
Posts: 534
Location: Mumbai
Send a message via Yahoo to prakash.raman
prakash.raman's Avatar
prakash.raman
Offline
Super Contributor
Quote:
Originally Posted by Tiger79 View Post
hhmm... dont get that....
are u saying to use the paint method instead of a layer ?
or using the paint method and a layer ? cause that would kinda be double work ?
Anyways thanks for taking time to help me ;)
Well I am not asking u to use paint, look into api's u can get the Graphic of an Image, and then call javax.microedition.lcdui.game.Layer.paint(Graphics g) with ur object of Background Layer and passing that Image Graphics as prameter. The method will paint the Graphics on that layer.

Prakash
Reply With Quote

#6 Old Re: Image or Sprite, thats the problem - 2007-10-02, 09:59

Join Date: Apr 2007
Posts: 1,757
Tiger79's Avatar
Tiger79
Offline
Forum Nokia Champion
Quote:
Originally Posted by tony_ysy View Post
Hi there,

Download the documentation and source codes from this example SheepDog game:

http://sw.nokia.com/id/748737bb-3d12...de_v2_0_en.zip

Here it explains all you wanted as above.

Have fun and play the game. :)
yeah The Sheepdog MIDlet I allready knew, funny game that is :P only problem is that they use it as an example for a TiledLayer background which I actually dont use... I have one big Image which I want to use as a Background... I noticed that the array containing the Imge is about 6000 elements, but when te Image is created it can take up to 300kb of memory !!!
But now another question arises :P Can I use TiledLayer for a big Image ? I tried (Image is 200x300) with a 4 by 5 array (50 by 60 pixels) but for some reason that wont work...
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Sending more than one OBEX image jogissa Bluetooth Technology 0 2007-09-21 11:10
how to cut some part of Image mshouab Mobile Java Media (Graphics & Sounds) 2 2006-08-04 10:05
HELP: Mutable Image to Immutable Image? rj_cybersilver Mobile Java Media (Graphics & Sounds) 1 2005-03-26 10:58
7650 Image Uploader strange problem kamlesh_in General Symbian C++ 1 2003-08-25 16:06
Sprites management remarks atomictag Mobile Java General 0 1970-01-01 02:00

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: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X 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