Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 31 of 49

How to set the angle of rotation of a Rectangle using FabricJS?

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

In this tutorial, we are going to set the angle of rotation 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. The angle property in FabricJS defines the angle of 2D rotation of an object. We also have the centeredRotation property that allows us to use the center point of a rectangle as the origin of transformation. Syntax new fabric.Rect({ angle: Number, centeredRotation: Boolean }) Parameters ...

Read More

FabricJS – How to set the size of the controlling corners of a Line?

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

In this tutorial, we are going to learn how to set the size of the controlling corners of Line 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.Line( points: Array, { cornerSize: Number }: Object) Parameters points − This parameter accepts an Array of points which determines the ...

Read More

How to straighten an Image with animation using FabricJS?

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

In this tutorial, we are going to learn how to straighten an Image with animation 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 straighten an Image with animation, we use the fxStraighten method. Syntax fxStraighten(callbacks: Object): fabric.Object Parameters callbacks − This parameter is an Object with callback functions which can be used to change certain properties related to ...

Read More

How to set the angle of skew on the Y-axis of a Triangle using FabricJS?

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

In this tutorial, we are going to learn how to set the angle of skew on the y-axis 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. Our triangle object can be customized in various ways like changing its dimensions, adding a background color or by changing the angle of skew on the Y-axis. We can do this by using the skewY property. Syntax new fabric.Triangle({ skewY : ...

Read More

FabricJS – How to set the stroke colour of the controlling corners of a Line?

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

In this tutorial, we are going to learn about how to set the stroke colour of controlling corners of 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. The cornerStrokeColor property allows us to ...

Read More

How to set the background colour of selection of a Triangle using FabricJS?

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

In this tutorial, we are going to learn how to set the background colour of selection 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 change an object's dimensions, rotate it or manipulate it when it is actively selected. We can change the background colour of selection of triangle by using the selectionBackgroundColor property. Syntax new fabric.Triangle({ selectionBackgroundColor : String }: Object) Parameters ...

Read More

How to add animation in Line using FabricJS?

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

In this tutorial, we are going to learn how to add animation in 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 animate a line instance we use the animate method. Syntax animate(property: String | Object, value: Number ...

Read More

How to set the angle of skew on x-axis of Rectangle using FabricJS?

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

In this tutorial, we are going to learn how to set the angle of skew on the x-axis 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. Our rectangle object can be customized in various ways like changing its dimensions, adding a background color or by changing the angle of skew on the x-axis. We can do this by using the skewX property. Syntax new fabric.Rect({ skewX: Number ...

Read More

How to cancel running animations in Line using FabricJS?

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

In this tutorial, we are going to learn about how to cancel running animations in 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 cancel running animations, we use the dispose method. Syntax dispose() Without using ...

Read More

How to set the border opacity of a Triangle while moving using FabricJS?

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

In this tutorial, we are going to set the border opacity of a Triangle while moving 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 opacity of a triangle while moving it around in the canvas by using the borderOpacityWhenMoving property. Syntax new fabric.Triangle({ borderOpacityWhenMoving: Number }: Object) Parameters Options (optional) − This parameter ...

Read More
Showing 301–310 of 490 articles
« Prev 1 29 30 31 32 33 49 Next »
Advertisements