Skip to content

How to capture screen and share the captured screenshot immediately with whatsApp or other apps. #134

Discussion options

You must be logged in to vote
val bitmap = Bitmap.createBitmap(
this.arSceneView.width,
    this.arSceneView.height,
    Bitmap.Config.ARGB_8888
)
PixelCopy.request(
    this.arSceneView, bitmap, { result ->
        when (result) {
            PixelCopy.SUCCESS -> {
                context?.createExternalFile(
                    environment = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
                        Environment.DIRECTORY_SCREENSHOTS
                    } else {
                        Environment.DIRECTORY_PICTURES
                    }, extension = ".png"
                )?.let { file ->
                    bitmap.compress(Bitmap.CompressFormat.PNG, 100, file.outputStream())
                    I…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ShankarKakumani
Comment options

@RGregat
Comment options

Answer selected by ShankarKakumani
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants