Find the Perimeter of a Rectangle in Swift

Ankita Saini
Updated on 02-Aug-2022 14:50:01

536 Views

This tutorial will discuss how to write a swift program to find the perimeter of a Rectangle.A rectangle is a 2-dimensional closed shape with four sides in which opposite sides are parallel and equal to each other. It also has four angle with 90 degrees each.The perimeter of the rectangle is used to calculate the boundary of the rectangle. Or we can say that it is the total distance covered by the rectangle’s outer boundary as show in the above diagram. It is the one of the most important formula of the rectangle. Suppose we want to fence our rectangular ... Read More

Calculate Simple Interest and Compound Interest in Swift

Ankita Saini
Updated on 02-Aug-2022 14:43:45

645 Views

This tutorial will discuss how to write a swift program to calculate the simple interest and compound interest. Compound Interest The interest applied on the principal and interest together over a certain period of time is known as the compound interest. Or in other words compound interest is known as the interest on interest. It is calculated after calculating amount. Formula Following is the formula of compound interest − Amount(A) = Principal(P)(1 + Rate/100)Time(t)C.I = Amount(A) - Principal(P) Where Principal(P) − Principal amount represents the amount which is initially invested. Rate(R) − Rate represents the interest rate which applied ... Read More

Set Width of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:26:35

879 Views

In this tutorial, we are going to learn how to set the width of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. However, one of the fundamental properties of textbox is width which specifies the horizontal width of the textbox. Syntax new fabric.Textbox(text: String, { width: Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display ... Read More

Set Vertical Scale Factor of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:22:06

244 Views

In this tutorial, we are going to learn how to set the vertical scale factor of a Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also set the vertical scale factor of a textbox object. This can be done by using the scaleY property. Syntax new fabric.Textbox(text: String, { scaleY ... Read More

Style Corners of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:19:52

360 Views

In this tutorial, we are going to learn how to set the style of controlling corners of Textbox using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox 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 ... Read More

Set Size of Controlling Corners of Textbox in Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:15:19

194 Views

In this tutorial, we are going to learn how to set the size of the controlling corners of a Textbox 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. Syntax new fabric.Textbox(text: String, { cornerSize: Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. ... Read More

Set Position of Textbox from Top Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:11:40

568 Views

In this tutorial, we are going to set the position of Textbox from top using FabricJS. The top property allows us to manipulate the position of the object. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. By default, the top position is relative to the canvas’s top edge. Syntax new fabric.Textbox(text: String, { top: Number }: Object) Parameters text − This parameter accepts a String which is the text string that ... Read More

Set Position of Textbox from Left Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:06:58

307 Views

In this tutorial, we are going to learn how to set the position of a Textbox from the left using FabricJS. We can customize, stretch or move around the text written in a textbox. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. The position from left can be changed by using the left property. Syntax new fabric.Textbox(text: String, { left: Number }: Object) Parameters text − This parameter accepts a String which is the text string that we want to display inside our textbox. ... Read More

Set Padding of Textbox using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 14:02:29

670 Views

In this tutorial, we are going to learn how to set the padding of a Textbox using FabricJS. Textbox is one of the various shapes provided by FabricJS. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. Just as we can specify the position, colour, opacity and dimension of a textbox object in the canvas, we can also set the padding of a textbox object. This can be done by using the padding property. Syntax new fabric.Textbox(text: String, { padding : Number }: Object) Parameters ... Read More

Set the Opacity of Textbox Using Fabric.js

Rahul Gurung
Updated on 02-Aug-2022 13:57:43

284 Views

In this tutorial, we are going to learn how to set the opacity of Textbox using FabricJS. Textbox is one of the various shapes provided by FabricJS. In order to create a textbox, we will have to create an instance of fabric.Textbox class and add it to the canvas. We can customize a textbox object by adding a fill colour to it, eliminate its borders or even make changes in its dimensions. Similarly, we can also change its opacity by using the opacity property. Syntax new fabric.Textbox(text: String, { opacity: Number }: Object) Parameters text − This parameter ... Read More

Advertisements