Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 37 of 49

How to set the vertical scale factor of a Triangle using FabricJS?

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

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

Read More

How to create a canvas with progress cursor on hover over objects using FabricJS?

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

In this article, we are going to create a canvas with a progress cursor on hover using FabricJS. The progress cursor is one of the native cursor styles available which can be used in the FabricJS canvas too. FabricJS provides various types of cursors such as default, all-scroll, crosshair, col-resize, row-resize, etc. that reuse the native cursor under the hood. The hoverCursor property sets the style of the cursor when hovered over a canvas object. Syntax new fabric.Canvas(element: HTMLElement|String, { hoverCursor: String }: Object) Parameters ...

Read More

How to set the scale factor (border) of a Circle using FabricJS?

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

In this tutorial, we are going to set the scale factor (border) of Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we have to create an instance of fabric.Circle class and add it to the canvas. We can use the borderScaleFactor property which specifies the scale factor of objects controlling borders. Syntax new fabric.Circle({ borderScaleFactor: Number }: Object) Parameters options (optional) − This parameter is an Object which provides additional customizations to ...

Read More

How to set the width of a Triangle using FabricJS?

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

In this tutorial, we are going to learn how to set the width of a Triangle using FabricJS. Triangle is one of the various shapes provided by FabricJS. In order to create a triangle, we will have to create an instance of fabric.Triangle class and add it to the canvas. We can manipulate a triangle object by changing its position, opacity, stroke and also its dimension. FabricJS allows us to control an object's dimensions by using the width and height properties. Syntax new fabric.Triangle({ width: Number }: Object) Parameters ...

Read More

FabricJS – How to exclude Line object from being saved while using JSON.stringify()?

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

In this tutorial, we are going to learn how to exclude Line object from being saved while using JSON.stringify() in 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. Serialization is used in order to export canvas contents. In order to achieve this we use toObject() ...

Read More

How to create a canvas with text cursor on hover over objects using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 1K+ Views

In this article, we are going to create a canvas with a text cursor on hover using FabricJS. The text cursor is one of the native cursor styles available which can be used in the FabricJS canvas. FabricJS provides various types of cursors such as default, all-scroll, crosshair, col-resize, row-resize, etc. that reuse the native cursor under the hood. The hoverCursor property sets the style of the cursor when hovered over a canvas object. Syntax new fabric.Canvas(element: HTMLElement|String, { hoverCursor: String }: Object) Parameters ...

Read More

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

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

In this tutorial, we are going to learn how to set the size of the controlling corners of a Circle using FabricJS. 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 size by using the cornerSize property. Syntax new fabric.Circle({ cornerSize: Number }: Object) Parameters options (optional) − This parameter is an ...

Read More

How to set the fill colour of a Rectangle using FabricJS?

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

In this tutorial, we are going to learn how we can change the appearance of a Rectangle object by changing its fill colour 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 change the fill colour by using the fill property which allows us to specify the colour of the object's fill. Syntax new fabric.Rect({ fill: String }: Object) Parameters Options (optional) ...

Read More

How to find the complexity of a Line instance using FabricJS?

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

In this tutorial, we are going to learn about how to find the complexity 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 complexity of a Line object, we use the complexity method. This method will return ...

Read More

How to disable the interactivity of canvas using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 2K+ Views

In this article, we are going to learn how to disable the interactivity of canvas in FabricJS. The interactive layer on top of each object is one of the unique features of FabricJS. As soon as we initialize a canvas, it's possible to select the objects, drag them around or manipulate a group selection. However, all this can be undone by assigning the interactive property to False. Syntax new fabric.Canvas(element: HTMLElement|String, { interactive : Boolean }: Object) Parameters element − This parameter is ...

Read More
Showing 361–370 of 490 articles
« Prev 1 35 36 37 38 39 49 Next »
Advertisements