aspose file tools
The moose likes Java Micro Edition and the fly likes How to 'dim' the canvas? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "How to Watch "How to New topic
Author

How to 'dim' the canvas?

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
My midlet uses a canvas where ocassionally a little popup info box may appear in the centre of the canvas.

When it appears, I would like to make the surrounding area go darker.

Does anyone know how I could achieve this?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

The usual approach is to create a translucent window the same size as the screen, overlaying the screen and painted with a gray pattern (alternating black and clear pixels, for example.

Then the actual dialog would be overlaid on to of the translucent window.


Customer surveys are for companies who didn't pay proper attention to begin with.
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
So the end of my paint method is changing from:



to



...it seems to work ok. Is that the way you meant?

Also, rather than create one large image, is it less memory-intensive to create a smaller image and paint is several times to the canvas?

Cheers,
James

[ November 08, 2007: Message edited by: James Hodgkiss ]
[ November 08, 2007: Message edited by: James Hodgkiss ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to 'dim' the canvas?
 
Similar Threads
Adding a Canvas to the JScrollPane
How to check canvas is empty or not in javascript
general(intermediate)
Canvas resizing
Canvas in JScrollPane