Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Stretch

    Show / Hide Table of Contents

    Class Stretch

    Allows the user to define how to stretch the image.

    Inheritance
    System.Object
    Stretch
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class Stretch : Enum
    Remarks
    The below code snippet is an example to set Stretch to a node.
    Examples
    <input type="button" value="Export" @onclick="@OnExport" />
    <SfDiagram Height="600px" @ref="@Diagram">
    </SfDiagram>
    @code{
        SfDiagram Diagram;
       private void OnExport()
       {
           IExportOptions options = new IExportOptions()
           {
               Mode = ExportModes.Data,
               FileName = "region",
               Stretch = Stretch.Stretch,
               Region = DiagramRegions.Content,
               Format = FileFormats.SVG
           };
           Diagram.ExportDiagram(options);
       }
    }

    Fields

    Meet

    Preserves aspect ratio and scales view box to fit within page size.

    Declaration
    public const Stretch Meet
    Field Value
    Type Description
    Stretch

    None

    Does not preserve aspect ratio. Scales image to fit view box fully into viewport. Proportions will be distorted

    Declaration
    public const Stretch None
    Field Value
    Type Description
    Stretch

    Slice

    Preserves aspect ratio and slices off any part of the image that does not fit inside page size.

    Declaration
    public const Stretch Slice
    Field Value
    Type Description
    Stretch

    Stretch

    Stretch the entire image to the page in both horizontally and vertically.

    Declaration
    public const Stretch Stretch
    Field Value
    Type Description
    Stretch

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved