Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Get Coordinates of Shapes Like Triangle, Polygon On Canvas in JS?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 480
    Answer it

    See Below Code:

     

    import { Component, OnInit } from '@angular/core'; import { fabric } from "fabric/dist/fabric.js"; @Component({ selector: 'app-p-five', templateUrl: './p-five.component.html', styleUrls: ['./p-five.component.scss'] }) export class PFiveComponent implements OnInit { x:any; y:any; w:any; h:any; constructor() { } ngOnInit() { var canvas = new fabric.Canvas('c'); canvas.on('mouse:down'); var red = new fabric.Rect({ top: 100, left: 0, width: 80, height: 50, fill: 'red' }); canvas.add(red); var g = new fabric.Group([red]); g.inverted = true; } }

 0 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: