←Select platform

AnnLoadPictureEventArgs Class

Summary

Event data for the AnnRenderingEngine.LoadPicture event.

Syntax
C#
Objective-C
C++/CLI
Java
Python
public class AnnLoadPictureEventArgs : EventArgs 
@interface LTAnnLoadPictureEventArgs : NSObject 
public class AnnLoadPictureEvent extends LeadEvent 
public: 
   ref class AnnLoadPictureEventArgs : EventArgs 
class AnnLoadPictureEventArgs(EventArgs): 
Remarks

The members of this class are populated as follows when the AnnRenderingEngine.LoadPicture event occurs:

Member Description

Picture

The loaded picture object. The value of AnnPicture.Source is the URL of the image that just finished loading.

AnnObject

The owner AnnObject object

Container

The owner container

Error

Contains null if the image was loaded successfully; otherwise, this field will contain any error information.

Example
C#
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Engine; 
using Leadtools.Annotations.Rendering; 
using Leadtools.Codecs; 
using Leadtools.Annotations; 
using Leadtools.WinForms; 
 
public void AnnRenderingEngine_LoadPicture() 
{ 
   // get the current rendering engine 
   AnnRenderingEngine renderingEngine = _automation.AutomationControl.RenderingEngine; 
 
   // Change the default loading object placeholder to be a green border with semi-transparent background 
   AnnStroke stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Green"), LeadLengthD.Create(1)); 
   AnnBrush fill = AnnSolidColorBrush.Create("rgba(0, 0, 0, 0.5)"); 
 
   renderingEngine.LoadingPictureStroke = stroke; 
   renderingEngine.LoadingPictureFill = fill; 
 
   // Hook to the LoadPicture event 
   renderingEngine.LoadPicture += renderingEngine_LoadPicture; 
 
   // Create a new AnnHotspotObject with a picture from a remote server 
   double inch = 720; 
   AnnHotspotObject hotspot = new AnnHotspotObject(); 
   // Add the object at location 1,1 inch with size 4,2 inches 
   hotspot.Rect = LeadRectD.Create(1 * inch, 1 * inch, 4 * inch, 2 * inch); 
   // Set its picture 
   AnnPicture picture = new AnnPicture("ms-appx:///Assets/Logo.png"); 
   hotspot.Picture = picture; 
 
   // Add it to the container 
   AnnContainer container = _automation.Container; 
   container.Children.Add(hotspot); 
 
   _automation.Invalidate(LeadRectD.Empty); 
} 
 
void renderingEngine_LoadPicture(object sender, AnnLoadPictureEventArgs e) 
{ 
   // Check if an error occurred 
   if (e.Error != null) 
   { 
      // Show info about the error 
      string str = e.Error.Message; 
      str += "\nSource: " + e.Picture.Source; 
      str += "\nOwner object: " + e.AnnObject.FriendlyName; 
      Debug.WriteLine(str); 
   } 
} 
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.Annotations.Engine Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.