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

262
Views
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 answers
Answer question

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 Report

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 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!