Newer
Older
MonCalc / app / src / main / kotlin / jackall / moncalc / utils / BitmapUtil.kt
package jackall.moncalc.utils

import android.graphics.Bitmap
import android.view.View

/**
 * Created by matsumoto_k on 2017/11/07.
 */
class BitmapUtil {
    companion object {
        /**
         * viewをBitmapに変換する
         * @param view BitmapにしたいView
         * @return Bitmap
         */
        fun viewCapture(view: View): Bitmap {
            view.isDrawingCacheEnabled = true
            view.destroyDrawingCache()
            return view.drawingCache
        }
    }
}