In a class that extends the Canvas there is a method to Know the color of a determined pixel (colored previously )?
Because when i re-Draw on the screen i lose the previously information of the colour...
someone can help me?
Thank you!
In a class that extends the Canvas there is a method to Know the color of a determined pixel (colored previously )?
Because when i re-Draw on the screen i lose the previously information of the colour...
someone can help me?
Thank you!
There's no method but you can store the color in a variable before you repaint to another color.
[N]/Forum Nokia
wuatta, you can use Nokia UI API. There are two DirectGraphics.getPixels methods for this purpose. However, I consider them rather tricky to use, storing color value before painting may work more easily.
doctordwarf, AFAIK u cannot getPixels of the real screen because the Image is not MUTABLE
Dess, maybe you are right, I never tried it.
Personally I rely on knowledge what I drew before rather then regetting this ingo from the screen.
However, according to Javadoc supplied with the nokia simulators getPixels should work on any graphics context. Also it is known that you can paint only part of the screen letting other parts stay the same. This made me believe that getPixels could be used for getting color from a real screen.