- 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 538 Articles for HTML5 Canvas
![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)
549 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
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
121 Views
In this tutorial, we are going to learn how to set the style of controlling corners 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.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 change the style by using the cornerStyle property.Syntaxnew fabric.Rect({ cornerStyle: String ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
222 Views
In this tutorial, we are going to learn how to set the size of the controlling corners of a Rectangle 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 change the size by using the cornerSize property.Syntaxnew fabric.Rect({ cornerSize: 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)
297 Views
In this tutorial, we are going to set the position of Rectangle using FabricJS. The top property allows us to manipulate the position of the object. By default, the top position is relative to the object’s top.Syntaxnew fabric.Rect({ top: 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 object of which the top is a property.Options keystop − This property accepts a Number which allows us to set the top ... Read More
![Rahul Gurung](https://www.tutorialspoint.com/assets/profiles/442556/profile/60_203348-1648528599.jpg)
472 Views
In this tutorial, we are going to learn how to set the padding 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 padding of a rectangle object. This can be done by using the padding property.Syntaxnew fabric.Rect({ padding : Number }: Object)ParametersOptions (optional) − This parameter is an Object which ... Read More