brighten up an image

My problem:

I have an image. When i get with the mouse over the image i want that this specificated area around the mouse is brighter than before. Not the whole image only this area.

I wrote an applet which founds the mouse position on an image.

How can i brighten up the "mouse area"?

Can you give me a small source example or can you explain me what methods i can use.

Please give me a simple answer.

Thank u very much

Thomas Reinbacher

[494 byte] By [Thomas_Reinbacher] at [2007-9-27 14:20:14]
# 1

If you are using 1.3 or 1.4 you can load the image into a BufferedImage and change the pixle colors around the x,y of the mouse using the setRGB() method. Copy the original image to a image that you will draw on screen. Then simply run through all of the pixels within a certain distance of the mouse pointer and change their color to something brighter than what is already there. Then draw the new brighter image to the screen.

If you are using 1.2 or below you would have to use MemoryImageSource which is a pian but the process is basically the same.

zparticle at 2007-7-5 22:10:17 > top of Java-index,Other Topics,Java Game Development...
# 2

A slightly simpler way, would be to create an image that is the size and shape of the 'glow' that u want to follow mouse pointer.

Then manipulate the 'glow' image, so its alpha is low around the edges, and high in the centre.

Then simply drawing the glow image at the mouse pointers location.

pre-computing the brightness increase in this way would also be alot quicker. (though not entirely accurate ;)

Abuse at 2007-7-5 22:10:17 > top of Java-index,Other Topics,Java Game Development...