• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing individual pixels on a canvas (q for john or anyone else)

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,
Do you happen to know of any way to look at the current pixels that are drawn on a canvas object? I'm trying to implement a transparent menu system, which requires I get the current values of the pixels where my menu will overlap.
Is there anyway to do this? I've checked the api and nothing is jumping out at me as a solution.
thanks,
lance
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lance,
Unfortunately, there is no way to access the individual pixels on a Canvas, in MIDP 1.0
John
Core J2ME
 
Lance Titchkosky
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I pretty much figured that. I made my own Graphics class that stores a 100x96 (or widthxheight) array of ints (rgb pixels). Then to paint the buffer I call g.drawLine(x,y,x,y) (a line of size 1 pixel, only way I know of drawing a single pixel).
Anyways this works, but it is killer slow (10 sec refresh of a full screen repaint).
I've thought of another way of doing it, generating a png image from the pixel array and then just calling drawImage, but I suspect it will be too slow as well.
Too bad there isn't a fast way of drawing many pixels to the screen with midp 1.0..
lance
 
reply
    Bookmark Topic Watch Topic
  • New Topic