以下のコードを使用して、レイアウトを画像に変換しようとしています。
LinearLayout rlpage = (LinearLayout)findViewById(R.id.rlpage);
rlpage.setDrawingCacheEnabled(true);
Bitmap viewBitmap = rlpage.getDrawingCache();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
viewBitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] toSend = baos.toByteArray();
try {
fileOutputStream.write(toSend);
fileOutputStream.flush();
fileOutputStream.close();
}
catch(Exception e)
{
}
これが私のレイアウトです
これは出力画像です
これの理由とこれを克服する方法は何ですか?