[]
Represents the alignment of an image within its container.
public class ImageAlign
Initializes a new instance of the ImageAlign class.
public ImageAlign()
Initializes a new instance of the ImageAlign class.
public ImageAlign(ImageAlignHorz alignHorz, ImageAlignVert alignVert, bool stretchHorz, bool stretchVert, bool keepAspectRatio, bool tileHorz, bool tileVert)
alignHorz
ImageAlignHorzA value assigned to AlignHorz.
alignVert
ImageAlignVertA value assigned to AlignVert.
stretchHorz
boolA value assigned to StretchHorz.
stretchVert
boolA value assigned to StretchVert.
keepAspectRatio
boolA value assigned to KeepAspectRatio.
tileHorz
boolA value assigned to TileHorz.
tileVert
boolA value assigned to TileVert.
Gets the image alignment that centers an image.
public static readonly ImageAlign CenterImage
Gets the default image alignment.
public static readonly ImageAlign Default
Gets the image alignment that scales an image.
public static readonly ImageAlign ScaleImage
Gets the image alignment that stretches an image.
public static readonly ImageAlign StretchImage
Gets or sets the horizontal alignment of an image within a container.
public ImageAlignHorz AlignHorz { get; set; }
Gets or sets the vertical alignment of an image within a container.
public ImageAlignVert AlignVert { get; set; }
Gets or sets a value indicating whether an image should be resized to best fit within its container. See remarks for details.
public bool BestFit { get; set; }
Getting this property returns a Boolean conjunction (AND) of the StretchHorz, StretchVert and KeepAspectRatio values.
Setting this property to a true value sets StretchHorz, StretchVert and KeepAspectRatio to true.
Setting this property to a false value sets KeepAspectRatio only to false.
Gets or sets a value indicating whether the original aspect ratio is preserved when rendering an image. Used when StretchHorz or StretchVert is true.
public bool KeepAspectRatio { get; set; }
Gets or sets a value indicating whether an image is stretched horizontally to fill its container.
public bool StretchHorz { get; set; }
Gets or sets a value indicating whether an image is stretched vertically to fill its container.
public bool StretchVert { get; set; }
Gets or sets a value indicating whether an image is tiled horizontally within its container. Ignored if StretchHorz is true.
public bool TileHorz { get; set; }
Gets or sets a value indicating whether an image is tiled vertically within its container. Ignored if StretchVert is true.
public bool TileVert { get; set; }
Returns a string that represents the current ImageAlign.
public override string ToString()
A string that represents the current ImageAlign.