gl-react icon indicating copy to clipboard operation
gl-react copied to clipboard

surface.capture().data is not working for iOS

Open gmathiou opened this issue 4 years ago • 4 comments

Bug report

Surface.capture().data is not working for iOS, returns black pixels [0,0,0,0]. Works fine on Android and Web (DOM).

library version

├── [email protected] 
└─┬ [email protected] 
  └── [email protected] 

Expected behavior

Surface.capture().data should be returning the RGBA value of the specified pixel on Surface

Actual behavior

Returns [0, 0, 0, 0] no matter what the colour of the specified pixel

Steps to reproduce the behavior

const data = this.refs.surface.capture(x, y, 1, 1).data;
console.log("RGBA: ", data);

Where surface is a reference to the Surface component and x, y are the coords of the pixel to return the colour

gmathiou avatar Apr 21 '20 12:04 gmathiou

same issue, do you have any solution?

miradario avatar Dec 27 '22 15:12 miradario

This works on my machine ™️ (an iOS device)

this.refs.surface.glView.capture()

Morantron avatar Dec 27 '22 16:12 Morantron

This works on my machine ™️ (an iOS device)

this.refs.surface.glView.capture()

Hi @Morantron. What version are you using?

asobralr avatar Dec 27 '22 18:12 asobralr