我有一个LinearLayout我想要在图像中进行变换,但我看到它变成了位图,背景失去了透明度。然后我必须把它变成一个图像png并且这样做并且强加一个alpha等于零的透明背景只是部分透明。图像仅在纸白色上完全透明,如果纸张着色,则图像部分透明。我使用iText创建图像。
USE database;
SELECT students.last_name, students.first_name,
subjects.subject_name, entries.date_of_exam
FROM students,
entries,
subjects
JOIN entries e1
on (e1.student_id = students.student_id)
AND students.last_name IN (SELECT students.student_id FROM students)
JOIN entries e2 on (e2.subject_id = subjects.subject_id)
ORDER BY last_name;
我看到部分透明度是由色彩空间= 3我是我的。我正在使用iText创建pdf文件
答案 0 :(得分:1)
我没有使用Canvas,但我设置了BackgroundColor Transparent
:
mLinearLayout.setBackgroundColor(Color.TRANSPARENT);
mLinearLayout.setDrawingCacheEnabled(true);
mLinearLayout.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
mLinearLayout.layout(0, 0, 642, 400);
mLinearLayout.buildDrawingCache(true);
Log.i(TAG, "The color of background is: " +mCardLayout.getAlpha());
mBitmapLayoutPreview = Bitmap.createBitmap(mLinearLayout.getDrawingCache());
mLinearLayout.setDrawingCacheEnabled(false); // clear drawing cache
mBitmapLayoutPreview
是我的LinearLayout
,背景为Transparent