×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    Get pixel data from an image object on Nokia phones?

    Hi, I'm trying to do transparent sprites on the Nokia, but I have been unable to. Somehow I have the feeling I am missing something here. It's possible to draw an image directly but since one cannot access the data at a pixel level, you cannot add an alpha mask there (and the PNG loader doesn't support it either). So I want to use raw (1bpp byte array) for sprites since they take up less memory and support alpha mask through a second array. So now the question is how to load the image into the byte array. Is there a way to get the pixel data from an Image object using the Nokia game api? I have tried to get the graphics context from an immutable Image object, create a DirectGraphics object from that and use getpixels on it, but the emu came back with a 'illegalArgumentException: w | h negetive' (yes, it's mispelled in the emu as well even though width, height, x and y aren't negative at all (I even hardcoded them to 0,0,8,8 to test this).

    Is there a good trick to solve my problems? So either get pixel data from an Image object or find some other way to load images into my byte arrays?

    Thanks in advance,

    Niels Brouwers, Karma Studios

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    RE: Get pixel data from an image object on Nokia phones?

    I have read the reply to a post that wasn't written at the time I wrote the above, but I think that'll help me out just fine. Thanks!

Posting Permissions

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