https://kotlinlang.org logo
Title
u

user

06/27/2022, 4:31 AM
Android Screenshot Capturing Programtically I implemented the below function to capture a screenshot of the current view of my app. val v = this.view!! val w = v.width val h = v.height val bitmapBuffer = IntArray(w * h) val bitmapSource = IntArray(w * h) val intBuffer: IntBuffer = IntBuffer.wrap(bitmapBuffer) intBuffer.position(0) glReadPixels(0, 0, w, h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, intBuffer) var offset1: Int var offset2: Int for (i in 0 until...