Left Property

Summary

Gets or sets the padding width for the left edge of a viewer control.

Syntax

C#
C++/CLI
C++
public virtual float Left { get; set; } 
public: 
virtual property float Left { 
   float get(); 
   void set (    float ); 
} 
public:  
   virtual property Single Left 
   { 
      Single get() 
      void set(Single value) 
   } 

Property Value

The padding width in pixels.

Example

C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
 
public void ViewerBorderPaddingExample(RasterImageViewer viewer) 
{ 
   if (viewer.IsImageAvailable) 
   { 
      viewer.BorderPadding.Changed += new EventHandler(BorderPadding_Changed); 
      viewer.BorderPadding.All = 0; 
      int viewerWidth = viewer.Right - viewer.Left; 
      int viewerHeight = viewer.Bottom - viewer.Top; 
 
      int imageWidth = viewer.Image.Width; 
      int imageHeight = viewer.Image.Height; 
 
      if (imageWidth < viewerWidth) 
      { 
         viewer.BorderPadding.Left = (viewerWidth - imageWidth) / 2; 
         viewer.BorderPadding.Right = 0; 
      } 
 
      if (imageHeight < viewerHeight) 
      { 
         viewer.BorderPadding.Top = (viewerHeight - imageHeight) / 2; 
         viewer.BorderPadding.Bottom = 0; 
      } 
 
      viewer.BorderPadding.Changed -= new EventHandler(BorderPadding_Changed); 
   } 
} 
 
private void BorderPadding_Changed(System.Object sender, EventArgs e) 
{ 
   Console.WriteLine("BorderPadding Changed"); 
} 

Requirements

Target Platforms

See Also

Reference

ViewerBorderPadding Class

ViewerBorderPadding Members

Help Version 22.0.2023.2.9
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.WinForms Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.