The AnnPicture class provides a picture object that is used by several LEADTOOLS annotation object classes. The following LEADTOOLS annotation objects use the AnnPicture class:
Each of these classes (either through the direct implementation or inheritance) access properties that control how the AnnPicture is used in the annotation object.
AnnImageObject:
The AnnImageObject class derives from AnnRectangleObject and adds the Picture property to fill the object's Bounds.
AnnHotspotObject:
The AnnHotspotObject class derives from AnnImageObject and adds the DefaultPicture property to set the default AnnPicture used to fill the object's Bounds.
AnnFreehandHotspotObject:
The AnnFreehandHotspotObject class derives from AnnPolylineObject and adds both the Picture and DefaultPicture properties.
AnnPointObject:
The AnnPointObject class derives from AnnObject and adds both the Picture and DefaultPicture properties.
AnnStampObject: The AnnStampObject class derives from AnnTextObject and adds the Picture property.
The following examples will create an AnnStampObject with a picture stored in an external PNG file or data:
Using a .NET System.Drawing.Image
object:
// This example will create a new stamp object at the specified bounds and with the picture data from the specified PNG
// and add it to the container
void CreateStampFromPngFile(AnnContainer container, LeadRectD bounds, Image pngImage)
{
// Create a new AnnStampObject
AnnStampObject stampObject = new AnnStampObject();
// Set its bounds
stampObject.Rect = bounds;
// Set the picture from the PNG
AnnPicture picture = new AnnPicture(pngImage);
stampObject.Picture = picture;
// Add the stamp object to the container
container.Children.Add(stampObject);
}
Using PNG data stored in a byte array:
// This example will create a new stamp object at the specified bounds and with the picture data from the specified PNG
// and add it to the container
void CreateStampFromPngFile(AnnContainer container, LeadRectD bounds, byte[] pngImage)
{
// Create a new AnnStampObject
AnnStampObject stampObject = new AnnStampObject();
// Set its bounds
stampObject.Rect = bounds;
// Set the picture from the PNG
AnnPicture picture = new AnnPicture(pngImage);
stampObject.Picture = picture;
// Add the stamp object to the container
container.Children.Add(stampObject);
}
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