Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 20 of 49

How to set the position of an Ellipse from left using FabricJS?

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

In this tutorial, we are going to learn how to set the position of an Ellipse from the left using FabricJS. Ellipse is one of the various shapes provided by FabricJS. In order to create an ellipse, we will create an instance of fabric.Ellipse class and add it to the canvas. We can manipulate an ellipse object by changing its position, opacity, stroke and also its dimension. The position from left can be changed by using the left property. Syntax new fabric.Ellipse( { left: Number }: Object) Parameters ...

Read More

How to disable the centered rotation of Triangle using FabricJS?

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

In this tutorial, we are going to learn how to disable the centered rotation of 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. By default, all objects in FabricJS use their center as the point of rotation. However, we can change this behaviour by using the centeredRotation property. Syntax new fabric.Triangle({ centeredRotation: Boolean }: Object) Parameters ...

Read More

How to set the position of Textbox from left using FabricJS?

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

In this tutorial, we are going to learn how to set the position of a Textbox from the left using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The position from left can be changed by using the left property. Syntax new fabric.Textbox(text: String, { left: Number }: Object) Parameters text − This parameter accepts a String which is the text ...

Read More

FabricJS – How to scale an Image object to a given width?

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

In this tutorial, we are going to learn how to scale an Image object to a given width 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 scale an Image object to a given width, we use the scaleToWidth method. Syntax scaleToWidth(value: Number, absolute: Boolean): fabric.Object Parameters value − This parameter accepts a Number which determines ...

Read More

How to set the scale factor (border) of an Ellipse using FabricJS?

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

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

Read More

How to disable the centered scaling of a Triangle using FabricJS?

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

In this tutorial, we are going to learn how to disable the centered scaling of 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. When an object is scaled via controls, assigning a True value to the centeredScaling property makes the origin of transformation its center. By setting it to False, the scaling occurs from the corner being dragged. Syntax new fabric.Triangle({ centeredScaling: Boolean }: Object) Parameters ...

Read More

How to set the position of Textbox from top using FabricJS?

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

In this tutorial, we are going to set the position of Textbox from top using FabricJS. The top property allows us to manipulate the position of the object. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. By default, the top position is relative to the canvas's top edge. Syntax new fabric.Textbox(text: String, { top: Number }: Object) Parameters text − This parameter ...

Read More

How to enter editing state using function in IText using FabricJS?

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

In this tutorial, we are going to learn about how to enter editing state using function in IText 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

How to set a multiplier to scale a cloned image using FabricJS?

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

In this tutorial, we are going to learn how to set a multiplier to scale the cloned 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 set a multiplier to scale the cloned image, we use the multiplier property. Syntax cloneAsImage( callback: function, { multiplier: Number}: Object): fabric.Object Parameters callback (optional) − This parameter is a function which ...

Read More

How to set the size of the controlling corners of Ellipse using FabricJS?

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

In this tutorial, we are going to learn how to set the size of the controlling corners of an Ellipse 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 color to it, changing its size etc. We can change the size by using the cornerSize property. Syntax new fabric.Ellipse({ cornerSize: Number }: Object) Parameters options (optional) − This parameter is an ...

Read More
Showing 191–200 of 490 articles
« Prev 1 18 19 20 21 22 49 Next »
Advertisements