←Select platform

ImageSize Property

Summary

Image size of this item in pixels.

Syntax
C#
C++/CLI
public virtual LeadSize ImageSize { get; set; } 
public:  
   virtual property LeadSize^ ImageSize 
   { 
      LeadSize^ get() 
      void set(LeadSize^ value) 
   } 

Property Value

The image size of this item in pixels. Default value is 0,0.

Remarks

ImageSize is updated automatically by the item when a new value is set to Url, Image or SvgDocument. It can also be set to a custom value to create an item with a specific size for owner drawing or to be rendered at a later time using the virtualizer. For more information, refer to Image Viewer Items.

ImageSize property of ImageViewer will update this member if this is the active item when the viewer is used in single item mode.

Example
C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
if (_imageViewer.ActiveItem.HasImage) 
{ 
   LeadSize size = _imageViewer.ActiveItem.ImageSize; 
 
   // copy the ActiveItem to new Image... 
   RasterImage image2 = _imageViewer.ActiveItem.Image.Clone(); 
 
   // Resize the image to new size 
   SizeCommand cmd = new SizeCommand(size.Width / 2, size.Height / 2, RasterSizeFlags.None); 
   cmd.Run(image2); 
 
   // ... 
   // put your code here 
   // ... 
 
   image2.Dispose(); 
} 
Requirements

Target Platforms

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

Leadtools.Controls Assembly

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