Class ImageShape
Represents the behavior of the image shape.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class ImageShape : Shape, IDiagramObject, ICloneable
Constructors
ImageShape()
Initializes a new instance of the Image.
Declaration
public ImageShape()
ImageShape(ImageShape)
Creates a new instance of the Image from the given Image.
Declaration
public ImageShape(ImageShape src)
Parameters
Type | Name | Description |
---|---|---|
ImageShape | src | Image |
Properties
ImageAlign
Sets the alignment of the image within the node boundary.
Declaration
public ImageAlignment ImageAlign { get; set; }
Property Value
Type |
---|
ImageAlignment |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new ImageShape() { Type = NodeShapes.Image,ImageAlign=ImageAlignment.XMaxYMax,Scale= DiagramScale.Meet, Source = "https://i.imgur.com/Rr1jAAn.jpg" },
};
Scale
Allows you to stretch the image as you desire (either to maintain the proportion or to stretch).
Declaration
public DiagramScale Scale { get; set; }
Property Value
Type |
---|
DiagramScale |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new ImageShape() { Type = NodeShapes.Image,ImageAlign=ImageAlignment.XMaxYMax,Scale= DiagramScale.Meet, Source = "https://i.imgur.com/Rr1jAAn.jpg" },
};
Source
Gets or sets the ImageSource of the image.
Declaration
public string Source { get; set; }
Property Value
Type |
---|
System.String |
Examples
Node node = new Node()
{
// Position of the node
OffsetX = 250,
OffsetY = 250,
// Size of the node
Width = 100,
Height = 100,
Style = new ShapeStyle() { Fill = "#6495ED", StrokeColor = "white" },
Shape = new ImageShape() { Type = NodeShapes.Image,ImageAlign=ImageAlignment.XMaxYMax,Scale= DiagramScale.Meet, Source = "https://i.imgur.com/Rr1jAAn.jpg" },
};
Methods
Clone()
Creates a new image that is a copy of the current image.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | it returns Image |
Overrides
Implements
System.ICloneable