Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.2
|
Leadtools.Annotations Namespace : AnnImageObject Class |
[SerializableAttribute()] public class AnnImageObject : AnnRectangleObject, IAnnPictureObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
'Declaration <SerializableAttribute()> Public Class AnnImageObject Inherits AnnRectangleObject Implements IAnnPictureObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
'Usage Dim instance As AnnImageObject
[SerializableAttribute()] public ref class AnnImageObject : public AnnRectangleObject, IAnnPictureObject, System.ICloneable, System.IDisposable, System.Runtime.Serialization.ISerializable
The AnnAudioObject and the AnnHotspotObject classes inherit the AnnImageObject class and access the common Picture property through this inheritance. For more information, refer to Using Pictures in Annotation Objects
This example creates a new image object with top, left at 100, 200, width, height of 400, 600 pixels and then adds it to a container.
Imports Leadtools Imports Leadtools.Annotations Imports Leadtools.Codecs Imports Leadtools.WinForms Private Sub AnnImageObject_AnnImageObject(ByVal container As AnnContainer, ByVal imageFileName As String) Dim img As AnnImageObject = New AnnImageObject() Dim pic As AnnPicture = New AnnPicture(Image.FromFile(imageFileName)) pic.TransparentMode = AnnPictureTransparentMode.None pic.TransparentColor = Color.Black img.Picture = pic img.Bounds = New AnnRectangle(100, 200, 400, 600, AnnUnit.Pixel) container.Objects.Add(img) End Sub
using Leadtools; using Leadtools.Annotations; using Leadtools.Codecs; using Leadtools.WinForms; private void AnnImageObject_AnnImageObject(AnnContainer container, string imageFileName) { AnnImageObject img = new AnnImageObject(); AnnPicture pic = new AnnPicture(Image.FromFile(imageFileName)); pic.TransparentMode = AnnPictureTransparentMode.None; pic.TransparentColor = Color.Black; img.Picture = pic; img.Bounds = new AnnRectangle(100, 200, 400, 600, AnnUnit.Pixel); container.Objects.Add(img); }