I derived the Canvas class where in the paint method I draw an Image. When clicking a Command I want to draw in the Canvas a rectangle and a String inside the rectangle , and the Image will still be displayed behind the rectangle, so I want to darken a bit the Image because I want to make a visual effect like the one when showing LWUIT Dialog ( the tint color of the hidden Form ). So how to darken a bit the canvas in this situation ?
I derived the Canvas class where in the paint method I draw an Image
Share
Assuming that width and height of image are known, I’d probably first use use Image.getRGB to get ARGB values for image pixels.
Then, I’d scale the RGB values to make an effect of it becoming darker.
From an array obtained with
darkenmethod, darkened image could be made using Image.createRGBImage