wood burning stoves 2.0*
The moose likes Java Micro Edition and the fly likes How to 'dim' the canvas? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
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: 15662
    
  15

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://aspose.com/file-tools
 
subject: How to 'dim' the canvas?
 
Similar Threads
general(intermediate)
Adding a Canvas to the JScrollPane
How to check canvas is empty or not in javascript
Canvas in JScrollPane
Canvas resizing