Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 38 of 49

How to set the style of controlling corners of a Circle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 633 Views

In this tutorial, we are going to learn how to set the style of controlling corners of Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. The controlling corners of an object allow us to scale, stretch or change its position. We can customize our controlling corners in many ways such as adding a specific colour to it, changing its size etc. We can change the style by using the cornerStyle property. ...

Read More

How to set the horizontal scale factor of a Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 344 Views

In this tutorial, we are going to learn how to set the horizontal scale factor of a Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also set the horizontal scale of a rectangle object. This can be done by using the scaleX property. Syntax new fabric.Rect({ scaleX : Number ...

Read More

How to find the real center coordinates of a Line object using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 504 Views

In this tutorial, we are going to learn about how to find the center coordinates of a Line using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to find the real center coordinates of a Line object, we use the getCenterPoint method. ...

Read More

How to set the border color of a selection area on a canvas using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 906 Views

In this article, we are going to learn how to set the border color of a selection area on a canvas using FabricJS. A selection indicates whether a group selection should be enabled or not. FabricJS allows us to adjust the border color accordingly with the selectionBorderColor property. Syntax new fabric.Canvas(element: HTMLElement|String, { selectionBorderColor: String }: Object) Parameters element − This parameter is the element itself which can be derived using document.getElementById() or the id of the ...

Read More

How to set the vertical scale factor of Circle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 239 Views

In this tutorial, we are going to learn how to set the vertical scale factor of a Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a circle object in the canvas, we can also set the vertical scale of a circle object. This can be done by using the scaleY property. Syntax new fabric.Circle({ scaleY : Number }: ...

Read More

How to get the coordinates of a Line object using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 929 Views

In this tutorial, we are going to show how you can get the coordinates of a Line using FabricJS. A Line element is one of the basic elements provided in FabricJS. It is used for creating straight lines. Because line elements are geometrically one-dimensional and do not contain an interior, they are never filled. We can create a line object by creating an instance of fabric.Line, specifying the x and y coordinates of the line and adding it to the canvas. In order to get the coordinates of a Line object, we use the getCoords method. Syntax ...

Read More

How to set the color of a selection area on a canvas using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 923 Views

In this article, we are going to learn how to set the color of a selection area on a canvas using FabricJS. We can adjust the color using the selectionColor property. Syntax new fabric.Canvas(element: HTMLElement|String, { selectionColor: String }: Object) Parameters element − This parameter is the element itself which can be derived using document.getElementById() or the id of the element itself. The FabricJS canvas will be initialized on this element. ...

Read More

How to set the width of stroke of Circle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 315 Views

In this tutorial, we are going to learn how to set the width of stroke for a Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. The strokeWidth property allows us to specify the width of a stroke for an object. Syntax new fabric.Circle({ strokeWidth: Number }) Parameters options (optional) − This parameter is an Object which ...

Read More

How to set the opacity of a Rectangle using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 541 Views

In this tutorial, we are going to learn how to set the opacity of Rectangle using FabricJS. Rectangle is one of the various shapes provided by FabricJS. In order to create a rectangle, we will have to create an instance of fabric.Rect class and add it to the canvas. We can customize a rectangle object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also change its opacity by using the opacity property. Syntax ...

Read More

How to set the width of a selection area border on a canvas using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 833 Views

In this article, we are going to learn how to set the width of a selection area border on a canvas using FabricJS. A selection area indicates the area selected using the mouse and all objects under that area will get selected. FabricJS allows us to adjust the width of the selection area border with the selectionLineWidth property. Syntax new fabric.Canvas(element: HTMLElement|String, { selectionLineWidth: Number }: Object) Parameters element − This parameter is the element itself which can be derived using document.getElementById() ...

Read More
Showing 371–380 of 490 articles
« Prev 1 36 37 38 39 40 49 Next »
Advertisements