Add Stroke to a Textbox Using Fabric.js

Rahul Gurung
Updated on 29-Jul-2022 12:04:10

415 Views

In this tutorial, we are going to learn how to add stroke to 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. Our textbox 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.Textbox(text: String, { stroke : String }: Object)Parameterstext − This ... Read More

Add Shadow to a Textbox Using Fabric.js

Rahul Gurung
Updated on 29-Jul-2022 12:00:42

812 Views

In this tutorial, we are going to learn how to add a shadow to 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. Our textbox 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 textbox by using the shadow property.Syntaxnew fabric.Textbox(text: String, { shadow : fabric.Shadow }: Object)Parameterstext − This ... Read More

Add Dashed Stroke to Textbox Using Fabric.js

Rahul Gurung
Updated on 29-Jul-2022 11:57:49

232 Views

In this tutorial, we are going to learn how to add a dashed stroke to 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. The strokeDashArray property allows us to specify a dash pattern for the object's stroke.Syntaxnew fabric.Textbox(text: String, { strokeDashArray: Array }: Object)Parameterstext − This parameter accepts a String which is the text string that we want to display inside our textbox.options(optional) − This parameter is an Object ... Read More

Difference Between HashMap and TreeMap in Java

Pradeep Kumar
Updated on 29-Jul-2022 11:42:50

3K+ Views

Both HashMap and TreeMap are considered to be Map classes because they both carry out the responsibilities of the Map interface. A Map is an object that stores key-value pairs, in which there is only one instance of each key but there may be multiple instances of the value. The hash table is a type of data structure that is utilised by the HashMap class. As a form of data storage, the red-black tree is utilised by the TreeMap.What is a HashMap?A HashMap uses a data structure known as the hash table in order to store the map's key-value pair. ... Read More

Convert 3-Digit Color Code to 6-Digit Color Code Using JavaScript

Kalyan Mishra
Updated on 29-Jul-2022 10:38:47

1K+ Views

In this tutorial, we will see how to convert 3-digit color code to 6-digit color code in JavaScript.So, basically three-digit color code represents the three-digit value of the colour of the form in #RGB format. To convert 3-digit color hex color to 6-digit we just have to do is convert every element of the three digit and make it duplicate.If we say in easy manner, then duplicating the three-digit color will give the hexadecimal whose value is same as three-digit color value.3-digit value: #RGB will be written as #RRGGBB in 6-digit color code.For example, 3-digit value: #08c 6-digit color Code: ... Read More

Swap Two Numbers in Swift Program

Ankita Saini
Updated on 29-Jul-2022 10:28:13

3K+ Views

This tutorial will discuss how to write a swift program to swap two numbers. Swapping of two variables means mutually exchanging the values of two variables.Swapping using temporary variableGiven two variables Number1 and Number2 now we swap their values with each other using a temporary variable Numtemp. It is the most easiest way to swap two numbers.AlgorithmThe algorithm is explained below −Step 1 − Declare three integer variables: Number1, Number2 and Numtemp(temporary variable.)Step 2 − Assign values to Number1 and Number2Step 3 − Assign Number1 to NumbertempStep 4 − Assign Number2 to Number1Step 5 − Assign Numbertemp to Number2Step 6 ... Read More

Find the Area of a Circle in Swift

Ankita Saini
Updated on 29-Jul-2022 10:10:06

1K+ Views

This tutorial will discuss how to write a swift program to find the area of a Circle.In a circle, an area is known as the space that is enclosed inside the boundaries of the circle in the two-dimensional plane. Suppose we have a round tea table now the area of the circle helps us to find how much cloth we required to cover the top of the table. We can calculate the area of the circle with the help of the radius or diameter, here, We are going to use the formula of area of the circle −Area of the ... Read More

Swap Numbers Without Using Temporary Variable in Swift

Ankita Saini
Updated on 29-Jul-2022 10:07:16

14K+ Views

This tutorial will discuss how to write a swift program to swap two numbers without using temporary variable. Swapping of two variables means mutually exchanging the values of two variables.Swapping two numbers without using temporary variablesGiven two variables Number1 and Number2 now we swap their values without using any temporary variable. Here we use tuple to preform the swapping operation.AlgorithmThe algorithm is explained below −Step 1 − Declare two integer variables − Number1, and Number2Step 2 − Assign values to Number1 and Number2Step 3 − Use tuple syntax to swap −(Number1, Number2) = (Number2, Number1)Step 4 − Display the value ... Read More

Add Two Numbers in Swift Program

Ankita Saini
Updated on 29-Jul-2022 09:53:04

4K+ Views

This tutorial will discuss how to write a swift program to add two numbers.Adding two numbers in Swift language is simple and can be performed with the help of the addition arithmetic operator(+). The arithmetic addition operator (+) uses two numbers as operands and returns their sum as output.In this operator, both the operands should be of the same data types, For example swift allows adding a float into float without an issue but if we will try to add different types of data types using (+) operator then the compiler will raise an error, For example adding an Int ... Read More

Print a String in Swift Program

Ankita Saini
Updated on 29-Jul-2022 09:50:50

969 Views

This tutorial will discuss how to write a swift program toprint a string. A string is a collection of characters such as “TutorialsPoint”, “Hello Purnima! How are you?”, etc. Strings can also be represented by Unicode. We can easily create and modifies a strings because they are lightweight and readable, also we can do string interpolation. Strings can be used to insert variable, constants expressions, etc.SyntaxFollowing is the syntax for creating string type variableVar a : StringAlgorithm to print two stringsStep 1 − Define 2 VariablesStep 2 − Enter string into that variableStep 3 − Perform operations with that stringStep ... Read More

Advertisements