- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6685 Articles for Javascript
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
167 Views
In this tutorial, we are going to create a Rectangle with a crosshair cursor on hover over objects using FabricJS. Crosshair is one of the native cursor styles available which can be used on a FabricJS canvas too. FabricJS provides various types of cursors like default, all-scroll, crosshair, col-resize, row-resize, etc., which reuse the native cursor under the hood. The hoverCursor property sets the style of the cursor when hovered over a canvas object.Syntaxnew fabric.Rect({ hoverCursor: String }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, properties such as colour, ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
221 Views
In this tutorial, we are going to create a Rectangle with border colour 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.Since FabricJS is extremely flexible, we are allowed to customize our rectangle object in any way we like. One of the properties that FabricJS provides is borderColor which allows us to manipulate the colour of the border when our object is active.Syntaxnew fabric.Rect({ borderColor: String }: Object)ParametersOptions (optional) − This parameter is an Object ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
386 Views
In this tutorial, we are going to create a Rectangle with background colour 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 backgroundColor property allows us to assign a colour to our object’s background. It is the colour of the container where the rectangle lives and is rectangular in shape for the rectangle.Syntaxnew fabric.Rect({ backgroundColor: String }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter, ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
488 Views
In this tutorial, we are going to learn how to create a canvas with a Rectangle object using FabricJS. Rectangle is one of the various 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.Syntaxnew fabric.Rect({ width: Number, height: Number }: 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 the rectangle object of which width and height ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
405 Views
In this tutorial, we are going to learn how to add stroke to 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 colour or by changing the colour of the line drawn around the object. We can do this by using the stroke property.Syntaxnew fabric.Rect({ stroke : String }: Object)ParametersOptions (optional) − This parameter is an Object which ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
242 Views
In this tutorial, we are going to learn how to add a shadow to 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 even adding a shadow to it. We can add a shadow to the rectangle by using the shadow property.Syntaxnew fabric.Rect({ shadow : fabric.Shadow }: Object)ParametersOptions (optional) − This parameter is an Object which ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
550 Views
In this tutorial, we are going to learn how to add a dashed stroke to 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 strokeDashArray property allows us to specify a dash pattern for the object's stroke.Syntaxnew fabric.Rect( { strokeDashArray: Array }: Object)ParametersOptions (optional) − This parameter is an Object which provides additional customizations to our rectangle. Using this parameter colour, cursor, stroke width and a lot of other properties can be ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
1K+ Views
In this tutorial, we are going to learn how to add curves to 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 a rectangle object by specifying its position, colour, opacity and dimension. However, we can also use properties like rx and ry which allow us to assign the horizontal and vertical border radius of a Rectangle.Syntaxnew fabric.Rect({ rx : Number, ry: Number }: Object)ParametersOptions (optional) − This parameter is an ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
379 Views
In this tutorial, we are going to learn how to set the width of stroke 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 strokeWidth property allows us to specify the width of a stroke for an object.Syntaxnew fabric.Rect( { strokeWidth: Number }: 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 ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
99 Views
In this tutorial, we are going to learn how to set the vertical scale factor 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.Just as we can specify the position, colour, opacity and dimension of a rectangle object in the canvas, we can also set the vertical scale of a rectangle object. This can be done by using the scaleY property.Syntaxnew fabric.Rect({ scaleY : Number }: Object)ParametersOptions (optional) − This parameter is ... Read More