Skip to main content

DiagramCustomShape.DefaultImageUrl Property

Specifies the shape image’s URL.

Namespace: DevExpress.Web.ASPxDiagram

Assembly: DevExpress.Web.ASPxDiagram.v23.1.dll

NuGet Package: DevExpress.Web


public string DefaultImageUrl { get; set; }

Property Value

Type Default Description
String String.Empty

The image URL.


A custom shape supports an inner image in two cases:

  • When a shape is created based on a card shape type (the BaseType property is set to CardWithImageOnLeft, CardWithImageOnRight, or CardWithImageOnTop). Note that in this case, the image size and position properties are not in effect, because they are predefined in the shape type.
  • When a shape is created based on a custom SVG image (with the BackgroundImageUrl property specified). In this case, you can use the following properties to customize inner image size and position: ImageHeight, ImageWidth, ImageLeft, and ImageTop.

Use the DefaultImageUrl property to specify the image URL.

<dx:DiagramCustomShape Type="Rounded Rectangle" BackgroundImageUrl="../Content/images/shapes/roundedRect.svg" 
  DefaultWidth="2" DefaultHeight="1" 
  ImageHeight="0.8" ImageWidth="0.3" ImageTop="0.1" ImageLeft="0.1"
  DefaultText ="Employee" TextLeft="0.4" TextWidth="0.6" />

The image below shows the result:

Custom Shape Text

If the AllowEditImage property is set to true, the diagram context menu displays commands that allow users to change the image.

Custom Shape Image Context Menu

See Also