×

Discussion Board

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

    getPixels method returning value -1

    Hi all,
    I have displayed a image on canvas and trying to get the some part of image using getPixesls method.But unable to do so.

    Can some one help me where i went wrong.
    Here the code snippet


    dg=DirectUtils.getDirectGraphics(g);
    dg.drawImage(img,x1,y1,0,0);

    where img is the image and x1 and y1 are defined cordinates.


    int format=dg.getNativePixelFormat();
    dg.getPixels(rgbdata,0,w3,x3,y3,w3,h3,format);

    where rgbdata is array, w3,x3,y3,h3 are defined int values.
    when i print the rgbdata itz printing -1

    I tried using int and short types aswell but no luck

    Where i went wrong.

    Thanks in advance
    phani

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    9
    Hi Phani,

    I have simular problem but my problem is it only gives me 0xffffff for every pixel.

    kwok

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    30
    I get 0xFFFFFFFF for every pixel when calling getPixels(..., TYPE_INT_8888_ARGB) on the Series 60 emulator (1.0).

    Does anyone know what format I should be using for Series 60?

    -- UPDATE -- Fixed my problem, my own dumb fault. Make sure the DirectGraphics instance you are using is really the graphics context of the image you're trying to read.

    Wes
    Last edited by wesbiggs; 2003-06-19 at 03:19.

Posting Permissions

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