Rahul Gurung

Rahul Gurung

490 Articles Published

Articles by Rahul Gurung

Page 27 of 49

FabricJS – Check if the Cache is Dirty and Renderer is Required for a Polygon?

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

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight-line segments. Since it is one of the basic elements of FabricJS, we can also easily customize it by applying properties like angle, opacity etc. We can check if the cache is dirty and the renderer is required by using the isCacheDirty method. This method checks whether the cache is dirty and thus lets FabricJS know that something in our canvas has changed which requires re-rendering. Syntax isCacheDirty(skipCanvas: ...

Read More

How to set the colour of the controlling corners of a Circle using FabricJS?

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

In this tutorial, we are going to set the colour of controlling corners of Circle using FabricJS. The cornerColor property allows us to manipulate the colour of the controlling corners when the object is active. Syntax new fabric.Circle({ cornerColor: String }: Object) Parameters options (optional) − This parameter is an Object which provides additional customizations to our circle. Using this parameter, properties such as colour, cursor, stroke width and a lot of other properties can be changed related to the object of which ...

Read More

How to make a Rectangle invisible using FabricJS?

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

In this tutorial, we are going to learn how to make a Rectangle invisible 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 making it visible or invisible. We can do this by using the visible property. Syntax new fabric.Rect({ visible: Boolean }: Object) Parameters ...

Read More

How to set the path side in IText using FabricJS?

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

In this tutorial, we are going to learn about how to set the path side 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 IText ...

Read More

FabricJS – How to center a Line object horizontally and vertically on a canvas?

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

In this tutorial, we are going to learn how to center a Line object horizontally and vertically on canvas 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 center the line object horizontally and vertically on the canvas we use the center() ...

Read More

How to set the border colour of Image in FabricJS?

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

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

Read More

FabricJS – Determining Whether fill or Stroke Should be Drawn First for a Polygon Object?

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

We can create a Polygon object by creating an instance of fabric.Polygon. A polygon object can be characterized by any closed shape consisting of a set of connected straight line segments. 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 determine whether fill or stroke should be drawn first, we use the paintFirst property. Syntax new fabric.Polygon( points: Array, { paintFirst: String }: Object ) Parameters points − This parameter accepts an Array ...

Read More

How to set the dash pattern of controlling corners of Circle using FabricJS?

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

In this tutorial, we are going to learn how we can implement the dash pattern of controlling corners of Circle 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 also specify a dash pattern for the controlling corners by using the cornerDashArray property. Syntax new fabric.Circle({ cornerDashArray: Array }: Object) Parameters options ...

Read More

How to make a Triangle invisible using FabricJS?

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

In this tutorial, we are going to learn how to make a Triangle invisible 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 making it visible or invisible. We can do this by using the visible property. Syntax new fabric.Triangle({ visible: Boolean }: Object) Parameters ...

Read More

How to set the quality level in the URL string of IText object using FabricJS?

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

In this tutorial, we are going to learn about how to set the quality level in the URL string of IText object 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 ...

Read More
Showing 261–270 of 490 articles
« Prev 1 25 26 27 28 29 49 Next »
Advertisements