Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
¿Por qué la imagen en mi aplicación de pintura no se muestra en la pantalla?
select("#loadButton").mouseClicked(function(){ var file = this.files[0]; file.src = URL.createObjectURL(this.files[0]); loadImage(file.src, img => { image(img, 0,0); }); });

Estoy creando una aplicación de pintura con p5.js e intento cargar un archivo de imagen, pero no aparece en la pantalla.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Necesita configurar una entrada de archivo y un controlador. Después de eso, debe escribir la imagen en el lienzo. Lo siguiente fue copiado directamente del sitio web de p5.js :

 let input; let img; function setup() { input = createFileInput(handleFile); input.position(0, 0); } function draw() { background(255); if (img) { image(img, 0, 0, width, height); } } function handleFile(file) { print(file); if (file.type === 'image') { img = createImg(file.data, ''); img.hide(); } else { img = null; } }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!