Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 29 of 49

How to add dashed stroke to a Circle using FabricJS?

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

In this tutorial, we are going to learn how to add a dashed stroke to a Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. The strokeDashArray property allows us to specify a dash pattern for the object's stroke. Syntax new fabric.Circle({ strokeDashArray: Array }) Parameters options (optional) − This parameter is an Object which provides additional customizations to our circle. Using this parameter, properties such as colour, ...

Read More

How to set the horizontal scale factor of a Circle using FabricJS?

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

In this tutorial, we are going to learn how to set the horizontal scale factor of a Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a circle object in the canvas, we can also set the horizontal scale of a circle object. This can be done by using the scaleX property. Syntax new fabric.Circle({ scaleX : Number }: ...

Read More

How to make the controlling corners of a Rectangle transparent using FabricJS?

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

In this tutorial, we are going to learn how to make the controlling corners of Rectangle transparent 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 transparentCorners property allows us to make the controlling corners of Rectangle transparent. Syntax new fabric.Rect({ transparentCorners: Boolean }: Object) Parameters Options (optional) − This parameter is an Object which provides additional ...

Read More

How to set the text overline of IText using FabricJS?

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

In this tutorial, we are going to learn how to set the text overline of 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 IText as ...

Read More

FabricJS – How to check if a specified control is visible in Line?

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

In this article, we are going to learn about how to check if a specified control is visible 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 check if a specified control is visible in Line object, we use the ...

Read More

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

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

In this tutorial, we are going to learn how to set the position of Image from left 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 the position of Image from left, we use the left property. Syntax new fabric.Image( element: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | String, { left: Number }: Object, callback: function) Parameters ...

Read More

How to create a canvas with a class using FabricJS?

Rahul Gurung
Rahul Gurung
Updated on 15-Mar-2026 730 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 add interactivity or styling as per requirement. Syntax new fabric.Canvas(element: HTMLElement|String, { containerClass: String}: Object) Parameters element − This parameter is the element itself which can be derived using document.getElementById() or the ...

Read More

How to add shadow to a Circle using FabricJS?

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

In this tutorial, we are going to learn how to add a shadow to a Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will create an instance of fabric.Circle class and add it to the canvas. Our circle object can be customized in various ways like changing its dimensions, adding a background color or even adding a shadow to it. We can add a shadow to a Circle by using the shadow property. Syntax new fabric.Circle({ shadow : fabric.Shadow }: Object) Parameters ...

Read More

How to set the minimum allowed scale value of Circle using FabricJS?

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

In this tutorial, we are going to learn how to set the minimum allowed scale of Circle using FabricJS. Circle is one of the various shapes provided by FabricJS. In order to create a circle, we will have to create an instance of fabric.Circle class and add it to the canvas. We can customize a circle object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also set its minimum allowed scale by using the minScaleLimit property. Syntax new fabric.Circle({ minScaleLimit : Number }: Object) ...

Read More

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

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

In this tutorial, we are going to set the angle of rotation 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. 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 triangle as the origin of transformation. Syntax new fabric.Triangle({ angle: Number, ...

Read More
Showing 281–290 of 490 articles
« Prev 1 27 28 29 30 31 49 Next »
Advertisements