1

Map

See the above map, actually I will have following images saved:

  1. D-Yellow.png
  2. D-Red.png
  3. D-Blue.png
  4. D-Green.png
  5. A-Yellow.png
  6. A-Red.png
  7. A-Blue.png
  8. A-Green.png

and so on.

That is B-Blue.png has the area marked Bin the above map, filled with blue color
In my Java program, I will use all the images in a array.
First initially screen will have the map above, the user can change the color by inputting the respective town name(i.e. A, B, C or D) and required color. Then I should replace that particular image with the prompted image.


Example
The user tells to change A to blue color, then following should appear: enter image description here

Please help me also how to display these images which have irregular borders as one image

Govind Balaji
  • 639
  • 6
  • 17
  • 4
    Make all images rectangular (with "regular borders"), paint only the region of interest, and make the rest of image transparent. Then merge them, [see here](http://stackoverflow.com/questions/2318020/merging-two-images). – linski Jul 30 '13 at 13:11
  • @linski Ok, but I have last doubt, How to make images transparent – Govind Balaji Jul 31 '13 at 03:34

1 Answers1

3

Prepare images with transparency, and then use compositing as explained here http://docs.oracle.com/javase/tutorial/2d/advanced/compositing.html

Basically compositing is achieved by setting a composite attribute to the Graphics2D object.

Sample code available here: Blending images in java

Community
  • 1
  • 1
Hakan Serce
  • 11,198
  • 3
  • 29
  • 48