Found 538 Articles for HTML5 Canvas

How to lock the horizontal skewing of Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 11:47:51

328 Views

In this tutorial, we are going to learn how to lock the horizontal skewing of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop skewing an object horizontally. This can be done by using the lockSkewingX property.Syntaxnew fabric.Rect({ lockSkewingX : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to ... Read More

How to lock the horizontal scaling of a Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 11:44:36

322 Views

In this tutorial, we are going to learn how to lock the horizontal scaling of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop scaling an object horizontally. This can be done by using the lockScalingX property.Syntaxnew fabric.Rect({ lockScalingX : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to ... Read More

How to lock the horizontal movement of Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 11:36:13

326 Views

In this tutorial, we are going to learn how to lock the horizontal movement of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want it to move only in the Y-axis. This can be done by using the lockMovementX property.Syntaxnew fabric.Rect({ lockMovementX: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed related to ... Read More

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

Rahul Gurung
Updated on 29-Jun-2022 10:28:09

226 Views

In this tutorial, we are going to learn how to lock the flipping during scaling of a Rectangle using FabricJS. Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also specify whether we want to stop flipping an object during scaling. This can be done by using the lockScalingFlip property.Syntaxnew fabric.Rect({ lockScalingFlip : Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width, and a lot of other properties can be changed ... Read More

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

Rahul Gurung
Updated on 29-Jun-2022 10:24:06

183 Views

In this tutorial, we are going to learn how to hide the controlling corners 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 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 its size, etc. We can also hide them using the hasControls property.Syntaxnew fabric.Rect({ ... Read More

How to hide the controlling borders of a Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 09:48:35

350 Views

In this tutorial, we are going to learn how to hide the controlling borders 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.We can customize our controlling borders in many ways such as adding a specific colour to it, a dash pattern, etc. However, we can also eliminate the borders completely by using the hasBorders property.Syntaxnew fabric.Rect({ hasBorders: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations ... Read More

How to flip a Rectangle vertically using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 09:28:55

192 Views

In this tutorial, we are going to learn how we can flip a Rectangle object vertically 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 flip a rectangle object vertically using the flipY property.Syntaxnew fabric.Rect({ flipY: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width and a lot of other properties can be changed related ... Read More

How to flip a Rectangle horizontally using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 09:23:43

327 Views

In this tutorial, we are going to learn how we can flip a Rectangle object horizontally 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 flip a rectangle object horizontally using the flipX property.Syntaxnew fabric.Rect({ flipX: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke width and a lot of other properties can be changed related ... Read More

How to disable the selectability of a Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 09:17:14

354 Views

In this article, we are going to learn how to disable selectability 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. In order to modify an object, we have to select it in FabricJS. However, we can change this behaviour by using the selectable property.Syntaxnew fabric.Rect{ selectable: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, ... Read More

How to disable the centered scaling of Rectangle using FabricJS?

Rahul Gurung
Updated on 29-Jun-2022 08:54:06

147 Views

In this tutorial, we are going to learn how to disable the centered scaling 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. When being scaled via controls, assigning a true value to the centeredScaling property, uses the center as the object's origin of transformation.Syntaxnew fabric.Rect({ centeredScaling: Boolean }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, cursor, stroke ... Read More

Advertisements