小编Ele*_*tro的帖子

如何使用意图共享分享GIF图像到可用的应用程序?

我想与whatsapp等可用的应用程序共享.gif,但无法在我的drawable资源中获得有效的Uri gri.

 Uri path = Uri.parse("android.resource://my_package_name/" + R.drawable.gif_1);
    Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND);
    shareIntent.setType("image/gif");
    shareIntent.putExtra(Intent.EXTRA_STREAM, path);
Run Code Online (Sandbox Code Playgroud)

有很多关于共享图像的解决方案,但没有关于gif共享的解决方案,请帮忙

android sharing gif android-intent

5
推荐指数
1
解决办法
4768
查看次数

有没有办法减少PNG大小?

作为 bm.compress(Bitmap.CompressFormat.PNG, 50, out); //here 50 will not work as PNG is lossless

如何减小 .png 图像大小?也只是从 drawable 处理外部位置使文件大小增加 5 到 10 倍?

Bitmap bm=BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher);

String extStorageDirectory = Environment.getExternalStorageDirectory().toString();

File file = new File(extStorageDirectory, "ic_launcher.PNG");
outStream = new FileOutputStream(file);
bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();
Run Code Online (Sandbox Code Playgroud)

png android image-compression

3
推荐指数
2
解决办法
6742
查看次数

标签 统计

android ×2

android-intent ×1

gif ×1

image-compression ×1

png ×1

sharing ×1