我有dialog
并将其转换为bitmap
。然后我想要发送它与共享意图:
Bitmap cs = null;
v1.setDrawingCacheEnabled(true);
v1.buildDrawingCache(true);
cs = Bitmap.createBitmap(v1.getDrawingCache());
Canvas canvas = new Canvas(cs);
v1.draw(canvas);
canvas.save();
v1.setDrawingCacheEnabled(false);
String path = Images.Media.insertImage(getContext().getContentResolver(), cs, "MyImage", null);
Uri file = Uri.parse(path);
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, file);
getContext().startActivity(Intent.createChooser(sharingIntent,"Share image using"));
v1
是对话框中TextView
的父级(v1
是我要发送的内容)。
如果我现在发送位图它的质量非常糟糕。我该如何改进?