Leadtools.Windows.Controls Send comments on this topic. | Back to Introduction - LEADTOOLS WPF | Help Version 16.5.9.25
ImageHorizontalAlignment Property
See Also 
Leadtools.Windows.Controls Namespace > BitmapSourceViewer Class : ImageHorizontalAlignment Property





Gets and sets a value that determines how to center the image in the control's client area horizontally, when the width of the destination rectangle is smaller than the width of the client area.

Syntax

Visual Basic (Declaration) 
Public Property ImageHorizontalAlignment As HorizontalAlignment
Visual Basic (Usage)Copy Code
Dim instance As BitmapSourceViewer
Dim value As HorizontalAlignment
 
instance.ImageHorizontalAlignment = value
 
value = instance.ImageHorizontalAlignment
C# 
public HorizontalAlignment ImageHorizontalAlignment {get; set;}
C++/CLI 
public:
property HorizontalAlignment ImageHorizontalAlignment {
   HorizontalAlignment get();
   void set (HorizontalAlignment value);
}
XAML Attributes Usage 

<object ImageHorizontalAlignment=HorizontalAlignment .../>

Dependencies Property Information 

Identifier field

ImageHorizontalAlignmentProperty

Metadata properties set to true

None

XAML Attributes Usage 

<object ImageHorizontalAlignment=HorizontalAlignment .../>

Dependencies Property Information 

Identifier field

ImageHorizontalAlignmentProperty

Metadata properties set to true

None

Return Value

A HorizontalAlignment enumeration value that determines how to center the image in the control's client area horizontally, when the width of the destination rectangle is smaller than the width of the client area. Default value is HorizontalAlignment.Center.

Example

For XAML example, refer to BitmapSourceViewer.

For C#/VB examples, refer to BitmapSourceViewer.

Remarks

As an example, this can be used to center a small image when it is displayed in a control that is larger than the image's dimensions (Width x Height).

This can also be used in conjunction with the ImageHorizontalAlignment property, SizeMode property and the ScaleFactor property to center an image when the zoomed display dimensions are smaller than the control's dimensions.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also