Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
How to draw writable rectangles on images using JS

Liveworksheets is a website for students and teachers where teachers can upload files with questions then after uploading the file the teacher answers these questions and then send this file to students -without answers of course- to answer it. There are many ways that can teacher use to solve these questions but the way that matters to me is the teacher can draw rectangles on an image and then write the answer on it.

My Question Is: How I Can draw writable rectangles on the image using javascript?

see the demo for clarity.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Konva js is a nice bet.

https://konvajs.org/

This tool allows you create shapes, and save everything to a database so you can reload all drawings to future usage.

Nice try

about 4 years ago · Juan Pablo Isaza Relatório

0

FINALLY, after a long of searching, I found Fabric.js, here is an example of my code

let fabricCanvas = new fabric.Canvas('your-canvas-id');

// You can change the canvas size via the next two lines
fabricCanvas.setHeight(document.getElementById('your-image').height);
fabricCanvas.setWidth(document.getElementById('your-image').width);

fabric.Image.fromURL(document.getElementById('your-image').src, function (img) {
    let textBox = new fabric.Textbox("Enter Your Answer", {
            fontSize: 16,
            fontFamily: 'Arial',
            textAlign: 'left',
            width: 180,
            top: 0,
            left: 0,
        });

    fabricCanvas.add(img.set({ left: 0, top: 0 }));
    fabricCanvas.add(textBox);
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda