×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    38

    Series 40 Transparency Issues

    <This is regarding losing transparency when moving to Series 40...>

    Up until now I've been using Series 60 for development of my game. Well, the new publisher only has a Series 40 handset (s40 3rd Ed FP2 to be exact). My current problem is that I'm losing transparency using one of the createImage() methods. This one works fine:

    Image image = createImage("/image.png");

    However, in order to cut down on overhead we've grouped our art into large files that we chop up upon load using the other createImage() method:

    Image SourceImage = createImage("/image.png");
    Image image = createImage(SourceImage, x, y, width, height, transform);

    That code has worked great so far, but I lose ALL transparency on the s40 3rd FP2 sdk. Is there some work around for this? I've tried doing it another way with

    Image SourceImage = createImage("/image.png");
    Image image = Image.createImage( width, height );
    image.getGraphics().drawImage( source_SourceImage , -x, -y, Tools.GRAPHICS_TOP_LEFT );

    But when I do this I get an "OutofMemoryError", and this is just loading up a single 1k image.

    Please help. I'm not sure what else to do.

    Thank you
    CreepyMo

  2. #2
    Registered User
    Join Date
    Jun 2007
    Posts
    3

    Re: Series 40 Transparency Issues

    I was actually having the exact same problem. The transparency didn't work with png's on the s40 3rd fp2, 5300 but worked fine on my s60's.

    I even I tried using gif instead of png, which seemed to work on a test image. However...once I tried replacing all my files, I got a bizarre OutOfMemory error. I checked the printouts and I had about 523k left. And condsidering that even with gif's all the art is only about 100k. Our jar is only 300k, so we're WAY within the limits of the device.

    Help anyone?

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    38

    Re: Series 40 Transparency Issues

    Quick update...I tried compressing the jar and still got my OutOfMemory issue. Do you still get that if compressed?

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    3

    Re: Series 40 Transparency Issues

    Is this an issue with other S40 3rd, FP2 phones? I have only tried on the 5300.

    As I say, though, never seen this problem on S60 handsets.

  5. #5
    Nokia Developer Moderator
    Join Date
    Nov 2006
    Location
    Helsinki
    Posts
    413

    Re: Series 40 Transparency Issues

    I'll try to investigate this in detail later, but maybe you could try using drawRegion()-method instead.. I've succesfully used transparent png-images on S40 devices that way.

    This is what the MIDP specs say:

    -----------------

    On some devices, pre-transformed images may render more quickly than images that are transformed on the fly using drawRegion. However, creating such images does consume additional heap space, so this technique should be applied only to images whose rendering speed is critical.

    -----------------

    So it may be bit slower, but should also save some heap space.

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    38

    Re: Series 40 Transparency Issues

    Thanx for the reply. You're right, drawRegion DOES work, however our animation/sprite system is based on taking large pieces of art with all the frames and breaking it up into smaller arrays of images to be drawn in sequence. Reworking our system to only draw parts of the original png instead of breaking it up WOULD work, but it would require a massive overhaul of some low level engine stuff. Not something I really want to try at this point. Especially since there's absolutely no reason why our method shouldn't work, there's nothing in the docs about issues on series 40:
    "The source image may be mutable or immutable. For immutable source images, transparency information, if any, is copied to the new image unchanged."

    Which is true...for series 60...but apparently not for series 40, unless there's a workaround I'm not aware of (hence the message board).

    CM

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    38

    Re: Series 40 Transparency Issues

    Actually...regarding the possible performace issue...we wrote our game without using any transformations at all. IE an animation of someone rotating is 4 frames, not just one frame rotated. So since our "int transform" arg is always Sprite.TRANS_NONE will that affect us at all?
    CM

  8. #8
    Registered User
    Join Date
    Jan 2010
    Posts
    4

    Thumbs down Re: Series 40 Transparency Issues

    Quote Originally Posted by bloodredsky View Post
    I'll try to investigate this in detail later, but maybe you could try using drawRegion()-method instead.. I've succesfully used transparent png-images on S40 devices that way.

    This is what the MIDP specs say:

    -----------------

    On some devices, pre-transformed images may render more quickly than images that are transformed on the fly using drawRegion. However, creating such images does consume additional heap space, so this technique should be applied only to images whose rendering speed is critical.

    -----------------

    So it may be bit slower, but should also save some heap space.

    please can u tell me how to create transparent png images . i wanna use it to make a full screen on the main menu of nokia 2600c phone

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Series 40 Transparency Issues

    You're always better to start a new thread for a new question, rather than posting on the end of a thead that died two and half years ago. You're more likely to get a helpful response.

    How you make an PNG with transparency depends on what software you use (Paint Shop Pro or whatever). Consult the documentation for the software you have.

    Not sure what you mean by "full screen on the main menu". You won't be able to see the phone's menu screen behind your application's screen. There is no way to achieve that.

    Graham.

Similar Threads

  1. MIDP applicatyion accessing a servlet not working in series 60 emulator
    By ferozekadamapuzha in forum Mobile Java General
    Replies: 11
    Last Post: 2008-05-07, 18:04
  2. How to set Image transparency for N-GAGE QD
    By joethegong in forum Mobile Java General
    Replies: 9
    Last Post: 2006-08-28, 09:45
  3. Series 60 Emulator 2.1 vs 2.0 issues
    By tkvalentine in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-02-04, 17:31
  4. Transparency Help for Series 60 MIDP 1.0
    By joethegong in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-01-13, 08:27
  5. Multi-threaded animation issues, porting from Series 40 to 60
    By skarsten in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-08-08, 13:07

Posting Permissions

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