Gets any error information should the picture not load successfully.
public Exception Error { get; }
@property (nonatomic, strong, readonly, nullable) NSError *error;
public Exception getError()
public:
property Exception^ Error
{
Exception^ get()
}
Error # get (AnnLoadPictureEventArgs)
The error information if the picture was not loaded successfully; otherwise, null.
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);
}
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.