Introduction
In this article, we draw a circle in a web application using TypeScript.
First, we download some files in the following attachment:
-
Kinect.d.ts
-
Kinectic.min.js
These file are added to the project then use the following procedure:
Step 1
Open Visual Studio 2012 and click "File" -> "New" -> "Project...". A window is opened. In this window, click "HTML Application for TypeScript" under Visual C#.
Give the name of your application as "Draw_Circle" and then click "Ok".
Step 2
After this session the project has been created; A new window is opened on the right side. This window is called the Solution Explorer. The Solution Explorer contains the ts file, js file and css file and aspx page.

Coding
app.ts
- /// <reference path="Kinect.d.ts" />
- class Draw_Circle
- {
- Circle()
- {
- var stage = new Kinetic.Stage({
- container: 'content',
- width: 250,
- height: 200
- });
- var layer = new Kinetic.Layer();
- var circle = new Kinetic.Circle({
- x: stage.getWidth() / 2,
- y: stage.getHeight() / 2,
- radius: 70,
- fill: 'blue',
- stroke: 'black',
- strokeWidth: 4,
- });
- layer.add(circle);
- stage.add(layer);
- }
- }
- window.onload = () =>
- {
- var obj = new Draw_Circle();
- obj.Circle();
- };
Image_Animation_Demo.aspx

Join the conversation! Your thoughts help the community grow.