Back to Devexpress

DiagramImage.StretchMode Property

wpf-devexpress-dot-xpf-dot-diagram-dot-diagramimage.md

latest3.3 KB
Original Source

DiagramImage.StretchMode Property

Specifies whether to preserve the aspect ratio of the source image when resizing the diagram image item. This is a dependency property.

Namespace : DevExpress.Xpf.Diagram

Assembly : DevExpress.Xpf.Diagram.v25.2.dll

NuGet Package : DevExpress.Wpf.Diagram

Declaration

csharp
public StretchMode StretchMode { get; set; }
vb
Public Property StretchMode As StretchMode

Property Value

TypeDescription
StretchMode

A StretchMode enumeration value.

|

Available values:

NameDescription
Stretch

Fit the image item while preserving the native aspect ratio of the source image.

| | Uniform |

Stretch the source image to fill the diagram image item.

| | UniformToFill |

Fill the image item while preserving the native aspect ratio of the source image. The image is clipped if its aspect ratio differs from the image item.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the StretchMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-diagram-use-diagramorgchartbehavior-to-generate-diagram-from-collection/CS/OrgChartBindingExample/MainWindow.xaml#L18

xml
<dxdiag:DiagramContainer Anchors="Left, Top" CanCopyWithoutParent="True" ConnectionPoints="0.5,0 1,0.5 0.5,1 0,0.5" CanAddItems="False" DragMode="ByAnyPoint" Height="190" ItemsCanChangeParent="False" ItemsCanAttachConnectorEndPoint="False" ItemsCanAttachConnectorBeginPoint="False" ItemsCanSelect="False" ItemsCanEdit="False" ItemsCanCopyWithoutParent="False" ItemsCanMove="False" ItemsCanRotate="False" ItemsCanSnapToOtherItems="False" ItemsCanDeleteWithoutParent="False" ItemsCanSnapToThisItem="False" ItemsCanResize="False" Padding="1" Position="-25,150" Shape="StandardContainers.Plain" ThemeStyleId="ShapeId.Moderate5" Width="322">
    <dxdiag:DiagramImage Anchors="All" Angle="0" CanSnapToThisItem="False" CanResize="False" CanCopyWithoutParent="False" CanMove="False" CanSnapToOtherItems="False" CanSelect="False" CanRotate="False" CanCopy="False" Height="190" Position="0,0" StretchMode="UniformToFill" ThemeStyleId="ShapeId.Balanced5" Width="142">
        <dxdiag:DiagramImage.Bindings>

See Also

DiagramImage Class

DiagramImage Members

DevExpress.Xpf.Diagram Namespace