Class Scale
It allows the user to stretch the image as desired.
Inheritance
System.Object
Scale
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public sealed class Scale : Enum
Remarks
To know more about using the scale, refer to these links |
1. Shapes |
To apply the scale to meet, use the below code. |
Examples
<SfDiagram Height="600px" Nodes="@NodeCollection"/>
@code{
//Initialize node collection with node
ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>()
{
//Creates an image node
new DiagramNode()
{
Id="node1",
//Size of the node
Height=100,
Width=100,
//Position of the node
OffsetX=100,
OffsetY=100,
//Sets type of the shape as image
Shape=new DiagramShape (){Type=Shapes.Image,Source="/diagram/images/syncfusion.png",Scale=Stretch.Meet, Align = ImageAlignment.XMinYMin}
}
};
}
Fields
Meet
It aligns the image to the center of the node.
Declaration
public const Scale Meet
Field Value
Type | Description |
---|---|
Scale |
None
There will be no scaling to the image.
Declaration
public const Scale None
Field Value
Type | Description |
---|---|
Scale |
Slice
It zooms in to fill the node.
Declaration
public const Scale Slice
Field Value
Type | Description |
---|---|
Scale |
value__
Declaration
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |