×

Discussion Board

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

    Obtiaing Pixel Formats

    I'm using the getNativePixelFormat() to find the local pixel format of each phone.

    Although the getNativePixelFormat() returns a value, when I place it in the follwoing code it throws the following error:
    "java.lang.IllegalArgumentException: Display format not supported on device 4444".

    private Image ImageSource(int array[], int width, int height) {
    Image img = DirectUtils.createImage(width, height, 0xf0000000);
    Graphics myG = img.getGraphics();
    DirectGraphics dg = DirectUtils.getDirectGraphics(myG);
    dg.drawPixels(array, true, 0, width, 0, 0, width, height, 0,
    dg.getNativePixelFormat());
    return img;
    }

    However if I place "8888" in the same code then it works. This is not logical as getNativePixelFormat() is returning 4444, not 8888.

    Your help will be greatly apprecieted.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4
    I dunno really, if you're testing on a series 40 device or emulator the 444 should be correct cuz these devices use 12 bit color.
    Anybody got insight on this one ?

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    6

    4444

    If 4444 is the correct type (and I think it is), the pixel array needs to be an array of shorts, not ints.

Posting Permissions

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