Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / December 2003

Tip: Looking for answers? Try searching our database.

Filling a bitmap image with java 1.3.1

Thread view: 
Patrick Baeyens - 08 Dec 2003 10:21 GMT
I need to fill parts of a bitmap, representing European country's
electional cantons, with different colors, one per canton. I would
like to know what would be the best way to do it on a pure java awt
environment.

Thanks a lot.
VK - 08 Dec 2003 22:52 GMT
Depends on what map do you have in your mind. If a simple schematic map,
I would suggest to spend some initial time to make a polygon for each
canton (a set of x,y coords).
Then use fillPolygon method in Graphics to draw cantons.
Marco Schmidt - 09 Dec 2003 00:04 GMT
Patrick Baeyens:

>I need to fill parts of a bitmap, representing European country's
>electional cantons, with different colors, one per canton. I would
>like to know what would be the best way to do it on a pure java awt
>environment.

Call getGraphics on your image and use the draw functions of the
Graphics(2D) object you received this way.

Regards,
Marco
Signature

Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html

Patrick Baeyens - 09 Dec 2003 08:38 GMT
> Patrick Baeyens:
>
[quoted text clipped - 8 lines]
> Regards,
> Marco

Thanks for the suggestion. This would mean I would first have to
convert my map of the country, which is white with the canton limits
in black, to a polygon map manually and then fill the polygons. Is
there any way I can do a fill operation straight on the bitmap (as in
paintshop-like programs) using java awt or any open source package?

Thanks,
Patrick


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.