On Sun, Nov 14, 2010 at 8:05 PM, Mikey <[email protected]> wrote:

> Here's my first issue. With this implementation, the user is able to pan
> the picture out of the screen or zoom out until it only takes up a pixel
> or two. Is there any better implementation that will not allow the user to
> pan beyond the borders of the image or zoom out past the image size?
>

For zooming, determine the max and min zoom levels you want to allow and
don't allow going past that.
For panning, as the image is panned, detect when been moved as much as it
can, then force the location back to that point. So if the left edge has
been panned to the right farther than the left of the screen, force the left
edge back to the left of the screen. Same idea for the other edges.

My question is, since I'm using an ImageView to put the png in, how can I
> draw on this?
>

Derive from ImageView, call super.onDraw() (or super.draw(), I forget), to
do the default image drawing, then draw your circle as required.


> I've been searching around all day and it appears that Canvas would be the
> ideal way, since you can call drawCircle(x, y, radius, paint). However, I
> was unable to find a way to correlate an ImageView to a Canvas and back.
>

The draw function gets a canvas - draw on that.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

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

Reply via email to