←Select platform

SvgDocument Property

Summary

SVG document associated with this item.

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

Property Value

The SVG document object associated with this item. Default value is null.

Remarks

The item can have either a value in Image or SvgDocument but not both. Setting one value will automatically delete the other.

When setting SvgDocument to a new value, the previous document will be automatically disposed if the value of AutoDisposeImages is set to true. Note that setting the same SvgDocument object into multiple items in the same viewer is supported, and the viewer will only dispose the document if it is the last reference found in all the items. When setting the same SvgDocument into items from separate viewers, the ownership and disposing of the SvgDocument objects must be handled by the user.

Changing the value of this property will fire the ItemChanged event with ImageViewerItemChangedReason will automatically be update as well with the DPI of the document.

The viewer will automatically optimize the SVG document for rendering if the value of AutoRenderOptimizeSvgDocuments is true when a new value is set into this property.

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

For more information, refer to Image Viewer Items.

Example
C#
using Leadtools; 
using Leadtools.Controls; 
using Leadtools.Codecs; 
using Leadtools.Drawing; 
 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
public void ImageViewerItemImage_Example() 
{ 
   ImageViewerItem item = _imageViewer.GetLargestVisibleItem(ImageViewerItemPart.Content); 
   if (item != null) 
   { 
      var image = item.Image.Clone(); 
      new InvertCommand().Run(image); 
      item.Image = image; 
      item.SvgDocument = null; 
   } 
} 
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.