IsImageAvailable Property

Summary

Determines if the control currently has an Leadtools.RasterImage object available for display.

Syntax

C#
C++/CLI
C++
public virtual bool IsImageAvailable { get; } 
[BrowsableAttribute(false)] 
public: 
virtual property bool IsImageAvailable { 
   bool get(); 
} 
public:  
   virtual property bool IsImageAvailable 
   { 
      bool get() 
   } 

Property Value

true if an image is available, false otherwise.

Remarks

If this property returns false, you should not attempt to read the Image property.

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

RasterImageViewer Class

RasterImageViewer 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.