Drawing on a web page using XAML

To integrate dynamic images into a web page, use the XAML canvas tag.

Canvas, a web program canvas, is simultaneously an interface consisting of widgets, graphical components such as buttons, lists, menus, etc. that make up the application interface, as well as a surface on which you can draw in vector mode.

Set up channel

A canevas has properties that can be modified:

Width - width.
Height - height.
Background - background color.
Opacity - Transparency.

These properties must be different from the ActiveX control properties defined in the initialization script in the agHost () function parameter.

Caneva example

<Canvas
  xmlns="http://schemas.microsoft.com/client/2007"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Heigh="100"
  Width="200"
  Background="Blue">
</Canvas>

Draw has a rectangle

Graphic elements are placed in XAML code directly as interface elements. You can insert a button or insert a rectangle!

The position of the object is determined by the Canvas properties:
Canvas.Left: horizontal position in the channel.
Canvas.Top: vertical position in the channel.

The basic properties of a Rectangle object that are common to other shapes are:
Height: Height.
Width: width.
Fill: Fill color.
Impact is the color of the outline.
StrokeThickness: path thickness

The rectangle also has its own properties:
RadiusX-Rounds the horizontal angle.
RadiusY-Round the vertical corner.

Example:

<Rectangle
  Canvas.Top="20"
  Canvas.Left="30"
  Height="100"
  Width="200"
  Fill="Red"
  Stroke="Black"
  StrokeThickness="1" 
  RadiusX="4"
  RadiusY="6"
/>
The XAML code is in the rectangle.xaml file. (Saved as rectangle-xaml.txt
). Other Basic Shapes
Line
Drow went to the line.
Properties: X1, X2, Y1, Y2 to define start and end points. The line is placed in the canvas as a rectangle with Canvas.Left and Canvas.Top.
Ellipse
Draws a circle or ellipse.
Properties of the rectangle, except for rounds. The circle will have equal Width and Height properties.
Ground
Closed shape with variable number of dimensions
The pattern is defined by a series of integer values separated by a comma, with pairs limited by a space. This definition is assigned to the Points property.
Example:
<Polygone
  Points="10,10 30,10 30,20 30,10 10,10" />
Polyline
A series of lines is connected, but does not necessarily format a closed picture. Same attributes as polygon.
Way
Represents a shape defined by points and curves.
The Data property is assigned a list of actual values, which are relative number pairs that may be preceded by a prefix for the shape.

To display a specified rectangle as an example: