Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 17 of 49

How to set the colour of controlling corners of Textbox using FabricJS?

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

In this tutorial, we are going to set the colour of the controlling corners of Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. We can also customize the text itself by using properties like fontSize, fontFamily, fontStyle, fontWeight etc. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The cornerColor property allows us to manipulate the colour of the controlling corners when the object is active. Syntax new fabric.Textbox(text: String, { cornerColor: String }: Object) ...

Read More

How to check if an IText object has a particular style property using FabricJS?

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

In this tutorial, we are going to learn about how to check if an IText object has a particular style property using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is ...

Read More

How to get the opacity of Image object using FabricJS?

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

In this tutorial, we are going to learn how to get the opacity of Image using FabricJS. We can create an Image object by creating an instance of fabric.Image. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to get the opacity of Image, we use the getObjectOpacity method. Syntax getObjectOpacity(): Number Parameters This method takes no parameters and returns the current opacity value as a Number between 0 and 1. Using the getObjectOpacity Method Let's ...

Read More

How to create a canvas using FabricJS?

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

In this article, we are going to create a canvas using FabricJS but before that let us understand what a canvas is. For drawing graphics on a webpage, we have a web API called Canvas API. This API is good for drawing basic shapes but adding interaction to it or drawing complex shapes becomes very difficult. Thus FabricJS comes into the picture which is a library built on top of the Canvas API. To use FabricJS, the first thing that needs to be done is to create a FabricJS Canvas. Syntax new fabric.Canvas(element: HTMLElement|String, options: Object) ...

Read More

How to hide the controlling corners of a Circle using FabricJS?

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

In this tutorial, we are going to learn how to hide the controlling corners of a 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. The controlling corners of an object allow us to increase or decrease its scale, stretch or change its position. We can customize our controlling corners in many ways such as adding a specific colour to it, changing their size etc. However, we can also hide them using the hasControls property. ...

Read More

How to create a Triangle with dash pattern border using FabricJS?

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

In this tutorial, we are going to create a triangle with a dash pattern border 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 change the appearance of the dashes of border by using the borderDashArray property. However, our triangle object must have borders enabled in order for this property to work. If the hasBorders property is assigned a false value, this property will not work. Syntax new fabric.Triangle({ ...

Read More

How to set the dash pattern of controlling corners of Textbox using FabricJS?

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

In this tutorial, we are going to learn how we can implement the dash pattern of controlling corners of Textbox 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 also specify a dash pattern for the controlling corners by using the cornerDashArray property. Syntax new fabric.Textbox(text: String, { cornerDashArray: Array }: Object) Parameters ...

Read More

How to check if the IText object has fill using FabricJS?

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

In this tutorial, we are going to learn about how to check if the IText object has fill using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true for ...

Read More

FabricJS – How to get the position of Image object with respect to origin?

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

In this tutorial, we are going to learn how to get the position of Image object with respect to origin using FabricJS. We can create an Image object by creating an instance of fabric.Image. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. In order to get the position of Image object with respect to origin, we use the getPointByOrigin method. Syntax getPointByOrigin(originX: String, originY: String): fabric.Point Parameters originX − This parameter accepts a String ...

Read More

How to lock the flipping during scaling of Circle using FabricJS?

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

In this tutorial, we are going to learn how to lock the flipping during scaling of a Circle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a circle object in the canvas, we can also stop flipping of an object during scaling. This can be done by using the lockScalingFlip property. Syntax new fabric.Circle({ lockScalingFlip : Boolean }: Object) Parameters options (optional) − This parameter is an Object which provides additional customizations to our ...

Read More
Showing 161–170 of 490 articles
« Prev 1 15 16 17 18 19 49 Next »
Advertisements