Andrey Agibalov
Andrey Agibalov

Reputation: 7694

2D graphics library for Android

I'm working on an Android application that requires 2D graphical view with a large set of objects. Here's what I basically need to display:

enter image description here

In my case, there could be hundreds of spatially distributed objects. This view is going to behave like a map, so the user is able to scroll in horizontally and vertically, zoom in and zoom out. It also requires click event handling, so the user is able to click any triangle and I then should display some extended information related with that particular triangle.

I'm mostly concerned about 3 things:

Is there any library that can help me with these tasks? Just don't want to spend 3 days on stuff that I believe must already have been implemented.

Upvotes: 4

Views: 3799

Answers (1)

Jasoneer
Jasoneer

Reputation: 2088

All the methods in the Canvas class of the android.graphics package should suffice. The Canvas does clipping (meaning drawing commands get discarded if it's not visible) so if the image is static you could render it into a Picture and draw that on onDraw().

I think the drawing methods have methods to calculate bounds and return them. See Path's computeBounds(RectF bounds, boolean exact).

Upvotes: 2

Related Questions