0
這是我的xml文件:捕獲框架佈局有這個問題
<RelativeLayout
android:id="@+id/relativeLayoutTemplateMain"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/LinearLayouttools"
android:layout_above="@+id/lltexttools"
android:layout_gravity="center">
<FrameLayout
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_centerInParent="true">
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="centerInside" />
</FrameLayout>
</RelativeLayout>
我捕捉的FrameLayout與此代碼:
fOut = new FileOutputStream(file);
framelayout.setDrawingCacheEnabled(true);
Bitmap bitmap = framelayout.getDrawingCache();
bitmap.compress(Bitmap.CompressFormat.jpeg, 100, fOut);
fOut.flush();
fOut.close();
,但周圍的人的照片是黑色的:
http://uupload.ir/files/z8cv_smsbaaz.ir_4.jpg
也當我設置scaleType =「FitXY」:
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:scaleType="FitXY"/>
image scale(我不想要縮放圖像) 我該如何解決這個問題?