开发者

Android Photo Viewer Demo

I've been trying to figure out how to display a photo on Android. I can create an ImageView and display a picture, but the functionality is limited (no zoom, pan or share). Is there a demo or tutorial with code out there on how to do this? I've been searching all week with no luck.

Thanks.

P.S.> Please No Snark!

Maybe I don't understand how to create a uri correctly or how to make my resource available to the viewer. I have a resource ID, R.drawable.opal, I'm using to display different minerals and ge开发者_开发知识库ms for a science project. If the student clicks the small sample photo, then I want to bring up a bigger and better viewer for the photo to allow them to compare to their collected rock.


Unless you really need to build your own you should probably just use the gallery's viewer. Send it the picture by using the view intent like so:

Intent viewImageIntent = new Intent(android.content.Intent.ACTION_VIEW, uri);
startActivity(viewImageIntent);

Replace "uri" with the image's uri of course. Writing your own viewer is really involved and would include threading, physics calculations and handling touch inputs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜