diff --git a/app/src/main/kotlin/jackall/moncalc/utils/BitmapUtil.kt b/app/src/main/kotlin/jackall/moncalc/utils/BitmapUtil.kt new file mode 100644 index 0000000..7931aeb --- /dev/null +++ b/app/src/main/kotlin/jackall/moncalc/utils/BitmapUtil.kt @@ -0,0 +1,22 @@ +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 + } + } +} \ No newline at end of file