简体   繁体   English

将图像从可绘制对象打开到画廊意图中

[英]Open image from drawable into gallery intent

I would like to open just one image and have pitch-zoom function, so (as I think) easiest way to do that is to open that image in gallery intent. 我只想打开一个图像并具有音调缩放功能,所以(我认为)最简单的方法是在图库意图中打开该图像。 Anybody can share example of how to call gallery intent with particular picture from drawable? 任何人都可以分享如何用drawable中的特定图片调用图库意图的示例?

I tried to used something like that but can't make it working (wrong file patch?). 我试图使用类似的方法,但是无法使其正常工作(错误的文件补丁?)。

Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.parse("com.me.example/drawable/thisimage.png"), "image/*");
            startActivity(intent);

According to this post 根据这篇文章

You should do something like: 您应该执行以下操作:

 String uriStr = "android.resource://"+ "com.example.myapp"+ "/" +  R.drawable.photo_h01;
 Uri uri = Uri.parse(uriStr);

I have not Eclipse in front of me but that's what I have found on several sources 我面前没有Eclipse,但这就是我从多个来源获得的信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM