view를bitmap 대상으로 변환

4129 단어 작업 중의 문제
 View mViewInflater = LayoutInflater.from(this).inflate(R.layout.item_gallery, null);
            ImageView mGalleryImage = (ImageView) mViewInflater.findViewById(R.id.gallery_image);
            mGalleryImage.setImageResource(galleryBean.mGalleryIm);
            TextView mData_tv = (TextView) mViewInflater.findViewById(R.id.data_tv);
            mData_tv.setText(galleryBean.dataYear);
            TextView mIntegralNumber = (TextView) mViewInflater.findViewById(R.id.integralNumber_tv);
            mIntegralNumber.setText(galleryBean.integralNumber);
            // 
            mViewInflater.setDrawingCacheEnabled(true);
            // , , bitmap null
            mViewInflater.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
                    View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
            // , 
            LogUtils.e(" :" + mViewInflater.getMeasuredWidth() + "....." + mViewInflater.getMeasuredHeight());
            mViewInflater.layout(0, 0, mViewInflater.getMeasuredWidth(),
                    mViewInflater.getMeasuredHeight());
//            mViewInflater.layout(0, 0, MobileUtils.px2dp(mViewInflater.getMeasuredWidth()),
//                    MobileUtils.px2dp(mViewInflater.getMeasuredHeight()));
            // Bitmap
            mViewInflater.buildDrawingCache();
            Bitmap mCacheBitmap = mViewInflater.getDrawingCache();
            Bitmap mBitmap = Bitmap.createBitmap(mCacheBitmap);

            if (mBitmap != null) {
                mGallery.add(mBitmap);
            }

좋은 웹페이지 즐겨찾기