Re: [android-developers] How to detect click on complex images/polygons

2010-12-24 Thread Frank Weiss
The first thing that comes to mind is java.awt.Polygon.contains(). I've used
it, but obviously with AWT and also with polygon data from
http://www.census.gov/geo/www/cob/

One approach then would be to find a similar Android polygon class that can
be used to draw and hit test your map and a way to convert the map's bitmap
image into a vector image, or at least a vector overlay for the bounds hit
test.

There are some ways you can get vector from a bitmap. I've used Visio by
putting the image on one layer and tracing out the vector shapes in another
layer, then writing some VB to export the shape vector data to XML. Do you
have Adobe CS? That might have some tools for converting bitmap shapes to
vectors. Or perhaps the image was originally authored with vectors?

There may also be some clever ways to do hit tests on the color values in
the bitmap.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to detect click on complex images/polygons

2010-12-23 Thread Achie
I am trying to have a complex image like this[http://
members.quicknet.nl/lm.broers/download/riskmap_en.png] in my
application. I want to let users click on the complex polygons
(countries with borders in this case) and highlight the polygon they
clicked on. I have the images that I need to use for that state.

How can I achieve this in android. [Preferably from Java but please
let me know any other options that are feasible].

Thank you

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en