Sto scattando istantanee e creato miniature e poi condivido questa immagine. Ma la miniatura mostra tutto nero. Ho usato il seguente codiceLa schermata mostra nero
Bitmap bitmap;
View v1 = v.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
String url = Images.Media.insertImage(
mContext.getContentResolver(), bitmap, "title", null);
Qualcuno può dirmi cosa c'è di sbagliato in questo codice.
EDIT
private View.OnClickListener shareListener = new View.OnClickListener() {
public void onClick(View v) {
Bitmap bitmap;
View v1 = v.getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
String url = Images.Media.insertImage(
mContext.getContentResolver(), bitmap, "title", null);
v1.setDrawingCacheEnabled(false);
Activity activity = (Activity) getContext();
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/jpeg");
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
activity.startActivity(Intent.createChooser(share,
"Share"));
}
};
nero Immagine
mettere un po 'più di codice ... – Riser
Questo è il codice che sto utilizzando per la cattura screenshot – Dilip
Hai controllato questo? http://stackoverflow.com/questions/16489086/take-screensot-and-save-android –