public ControlAlignment ImageHorizontalAlignment {get; set;}
Public Property ImageHorizontalAlignment As ControlAlignment
public ControlAlignment ImageHorizontalAlignment {get; set;}
@property (nonatomic) LTControlAlignment imageHorizontalAlignment;
public ControlAlignment getImageHorizontalAlignment() public void setImageHorizontalAlignment(ControlAlignment alignment)
get_ImageHorizontalAlignment();
set_ImageHorizontalAlignment(value);
Object.defineProperty('ImageHorizontalAlignment');
Changing the value of this property will fire the PropertyChanged and TransformChanged events.
Use ImageVerticalAlignment to set the vertical alignment for the image in the control.
using Leadtools; using Leadtools.Codecs; using Leadtools.Controls; [TestMethod] public void ImageHorizontalAlignmentExample() { // Loop through the image horizontal and vertical alignments ControlAlignment horizontalAlignment = _viewer.ImageHorizontalAlignment; ControlAlignment verticalAlignment = _viewer.ImageVerticalAlignment; if(horizontalAlignment == ControlAlignment.Near) horizontalAlignment = ControlAlignment.Center; else if(horizontalAlignment == ControlAlignment.Center) horizontalAlignment = ControlAlignment.Far; else if(horizontalAlignment == ControlAlignment.Far) horizontalAlignment = ControlAlignment.Near; if(verticalAlignment == ControlAlignment.Near) verticalAlignment = ControlAlignment.Center; else if(verticalAlignment == ControlAlignment.Center) verticalAlignment = ControlAlignment.Far; else if(verticalAlignment == ControlAlignment.Far) verticalAlignment = ControlAlignment.Near; // Show the values in the label string[] controlAlignmentNames = { "Near", "Center", "Far" }; _infoLabel.Text = controlAlignmentNames[(int)horizontalAlignment] + " and " + controlAlignmentNames[(int)verticalAlignment]; // Set the new values in _viewer _viewer.ImageHorizontalAlignment = horizontalAlignment; _viewer.ImageVerticalAlignment = verticalAlignment; }