繁体   English   中英

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

[英]Open image from drawable into gallery intent

我只想打开一个图像并具有音调缩放功能,所以(我认为)最简单的方法是在图库意图中打开该图像。 任何人都可以分享如何用drawable中的特定图片调用图库意图的示例?

我试图使用类似的方法,但是无法使其正常工作(错误的文件补丁?)。

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

根据这篇文章

您应该执行以下操作:

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

我面前没有Eclipse,但这就是我从多个来源获得的信息

暂无
暂无

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

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