Newer
Older
OverlayMultiCounter / app / src / main / kotlin / jackall / overlaymulticounter / utils / BitmapUtil.kt
MatsumotoKeiju on 10 Nov 2017 512 bytes [add] Show explanation until first overlay
package jackall.overlaymulticounter.utils

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

/**
 * Created by matsumoto_k on 2017/11/10.
 */
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
        }
    }
}