Skip to content

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

Open

Description

@gmathiou

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

├── gl-react@4.0.1 
└─┬ gl-react-native@4.0.1 
  └── gl-react-expo@4.0.1 

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

Activity

  1. self-assigned this
    on Dec 23, 2020
  2. miradario commented on Dec 27, 2022

    @miradario

    same issue, do you have any solution?

  3. Morantron commented on Dec 27, 2022

    @Morantron

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

    this.refs.surface.glView.capture()
    
  4. asobralr commented on Dec 27, 2022

    @asobralr

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

    this.refs.surface.glView.capture()
    

    Hi @Morantron. What version are you using?

  5. Morantron commented on Dec 28, 2022

    @Morantron

    gl-react@5.2.0
    gl-react-expo@5.2.1
    gl-react-native@5.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions