menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ImageShape - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ImageShape

    Represents the behavior of the image shape within a Node.

    Inheritance
    System.Object
    DiagramObject
    Shape
    ImageShape
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Shape.Type
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ImageShape : Shape, IDiagramObject, ICloneable
    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" },
    };

    Constructors

    ImageShape()

    Initializes a new instance of the ImageShape class.

    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

    The ImageShape instance to copy.

    Properties

    ImageAlign

    Gets or sets the alignment of the image within the node boundary.

    Declaration
    public ImageAlignment ImageAlign { get; set; }
    Property Value
    Type Description
    ImageAlignment

    An ImageAlignment specifying the alignment of the image. The default value is None.

    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

    Gets or sets the scaling option for the image.

    Declaration
    public DiagramScale Scale { get; set; }
    Property Value
    Type Description
    DiagramScale

    A DiagramScale specifying how the image is scaled. The default value is None.

    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 source URL for the image.

    Declaration
    public string Source { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the URL of the image source. The default value is null.

    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

    A new instance of ImageShape.

    Overrides
    Shape.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved