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
To display a specified rectangle as an example: