Coder Social home page Coder Social logo

Comments (12)

unmec avatar unmec commented on August 16, 2024 2

I am experiencing the same issue.
My use case here is to access local image and draw them on the canvas.

from react-native-canvas.

unmec avatar unmec commented on August 16, 2024 1

you can read that specific image and encode it into base64.

from react-native-canvas.

benniao-chen avatar benniao-chen commented on August 16, 2024 1

@macelii but camera photo transform to base64, and use this base64 data to draw in canvas, so slow!!!!

from react-native-canvas.

iddan avatar iddan commented on August 16, 2024 1

Have you tried using addEventListener()?

from react-native-canvas.

neerajamnair avatar neerajamnair commented on August 16, 2024 1

@iddan Got it working using addEventListener()

from react-native-canvas.

iddan avatar iddan commented on August 16, 2024

Will look into it

from react-native-canvas.

iddan avatar iddan commented on August 16, 2024

A little bit busy. PRs are welcome but I won't be able to handled this in the near future

from react-native-canvas.

benniao-chen avatar benniao-chen commented on August 16, 2024

@macelii how to access local image which has a relative path? example: "../../asset/images/a.png"

from react-native-canvas.

yogeshR5 avatar yogeshR5 commented on August 16, 2024

@iddan ctx.drawImage() is not working. when am I using I got the error like
"JSON.stringify cannot serialize cyclic structures"

from react-native-canvas.

iddan avatar iddan commented on August 16, 2024

We're using this API in production and it works fine. What is your use-case?

from react-native-canvas.

neerajamnair avatar neerajamnair commented on August 16, 2024

Any update?
Still not working for base 64 image and for .png image

 let tempSrc={uri: '........'};
    const image = new Image(this.canvas, 20, 20);
          image.onload = function() {
                this.ctx.beginPath();
                this.ctx.clearRect(0, 0, this.canvas.width, canvas.height);
                this.ctx.drawImage(image, 0, 0, this.canvas.width, this.canvas.height);
                this.ctx.closePath();
                this.ctx.save();
          }
          image.src = tempSrc.uri;
          image.onerror = function() {
      console.log("err")
          };

from react-native-canvas.

iddan avatar iddan commented on August 16, 2024

In the todo there is a task to emit a warning when using image.onload (or making it work). I'd appreciate help with it: but if I'll have a spare minute I'll add it ASAP

from react-native-canvas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.