Rahul Gurung has Published 548 Articles

How to create a canvas with a wait cursor using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:56:06

100 Views

In this article, we are going to create a canvas with a wait cursor using FabricJS. A wait cursor can be used to indicate a busy program in the background which also stops the user from interacting with the interface. wait is one of the native cursor style available which ... Read More

How to create a canvas with a crosshair cursor using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:51:33

255 Views

In this article, we are going to create a canvas with a crosshair cursor using FabricJS. Crosshair is one of the native cursor style available, which can be used in the FabricJS canvas too. FabricJS provides various types of cursors like default, all-scroll, crosshair, col-resize, row-resize, etc. which are reusing ... Read More

How to disable selection of objects via dragging in a canvas using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:47:28

2K+ Views

In this article, we are going to illustrate how you can disable the selection of objects via dragging in FabricJS. In a FabricJS canvas, we can basically click anywhere and select an area and any object in that area will get selected. In this article, we will see how to ... Read More

How to create a canvas with a class using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:39:28

492 Views

In this article, we will see how to create a canvas with a class on it using the containerClass property. In order to have access over the native HTML canvas element, we can add a wrapper class over it. This class allows us to have control over the element to ... Read More

How to create a canvas with background image using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:30:41

5K+ Views

In this article, we are going to create a canvas with a background image using FabricJS. There are two ways available in FabricJS, using which we can change the background image of the canvas.First method is by using the Canvas class itself and passing backgroundImage in the second parameter of ... Read More

How to create a canvas with a background color using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 19-May-2022 08:18:07

683 Views

In this article, we are going to create a canvas with a given background color using FabricJS. The default background color provided by the FabricJS API is white and it can be customized using the second argument.Syntaxnew fabric.Canvas(element: HTMLElement|String, { backgroundColor: String }: Object)Parameterselement − This parameter is the ... Read More

How to disable uniform scaling in canvas using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 24-Mar-2022 11:18:32

645 Views

In this article, we are going to learn about how to disable uniform scaling in canvas using FabricJS. In FabricJS, an object gets transformed proportionally when dragged from the corners. However, we can disable this behavior by using the uniformScaling property.Syntaxnew fabric.Canvas(element: HTMLElement|String, { uniformScaling: Boolean }: Object)Parameterselement − This ... Read More

How to add an object to the canvas using FabricJS?

Rahul Gurung

Rahul Gurung

Updated on 24-Mar-2022 08:13:29

989 Views

In this article, we are going to add an object to the canvas by using the add method. After creating our canvas, we can populate it with various objects available in FabricJS like fabric.Circle, fabric.Ellipse or fabric.Line, etc.Syntaxcanvas.add(object: fabric.Object);ParametersObject − This parameter is of type fabric.Object and holds the objects ... Read More

Advertisements