Graphics.getPixel always returns 0?

Posted on
  • Hello!

    In order to produce screenshots, I tried to read the contents of the screen, pixel per pixel.

    But when I try

    g.setPixel(0,0, 14);

    all I receive is 0 - when running in resolutions 240x240 and 240x160 (aka 'doublebuffered')

    How can I get the contents of a higher resolving display?

  • The 240x240 is not using a buffer, so you can’t read any pixel.

  • but 240x160 should do, shouldn't it?

  • Afraid not. A bit more info here:­n-buffering

    240x160 still writes direct to the screen (it just cuts the screen's 240x320 buffer in two in order to have an area that is offscreen) - but the pixels still reside on the LCD which cannot be read from

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Graphics.getPixel always returns 0?

Posted by Avatar for Andreas_Rozek @Andreas_Rozek