How to use the react-native-canvas.ImageData function in react-native-canvas

To help you get started, we’ve selected a few react-native-canvas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iddan / react-native-canvas / example / App.js View on Github external
context.getImageData(0, 0, 100, 100).then(imageData => {
      const data = Object.values(imageData.data);
      const length = Object.keys(data).length;
      for (let i = 0; i < length; i += 4) {
        data[i] = 0;
        data[i + 1] = 0;
        data[i + 2] = 0;
      }
      const imgData = new ImageData(canvas, data, 100, 100);
      context.putImageData(imgData, 0, 0);
    });
  }

react-native-canvas

A Canvas component for React Native

MIT
Latest version published 7 months ago

Package Health Score

64 / 100
Full package analysis