Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
LockPicture Property
See Also  Example
Leadtools.Windows.Annotations Namespace > AnnContainer Class : LockPicture Property





Gets or sets the AnnPicture used when drawing the locked symbol for locked objects. This is a dependency property.

Syntax

Visual Basic (Declaration) 
<DesignerSerializationVisibilityAttribute()>
Public Property LockPicture As AnnPicture
Visual Basic (Usage)Copy Code
Dim instance As AnnContainer
Dim value As AnnPicture
 
instance.LockPicture = value
 
value = instance.LockPicture
C# 
[DesignerSerializationVisibilityAttribute()]
public AnnPicture LockPicture {get; set;}
C++/CLI 
[DesignerSerializationVisibilityAttribute()]
public:
property AnnPicture^ LockPicture {
   AnnPicture^ get();
   void set (AnnPicture^ value);
}
XAML Syntax 
For XAML information, see the Leadtools.Windows.Annotations.AnnPicture type.

Dependencies Property Information 

Identifier field

LockPictureProperty

Metadata properties set to true

None

XAML Syntax 
For XAML information, see the Leadtools.Windows.Annotations.AnnPicture type.

Dependencies Property Information 

Identifier field

LockPictureProperty

Metadata properties set to true

None

Return Value

The AnnPicture used when drawing the locked symbol for locked objects.

Example

Visual BasicCopy Code
Public Sub AnnContainer_LockPicture(ByVal container As AnnContainer)
  ' we are going to create a new lock image that is 20 by 20 red ellipse with a blue cross inside it.
  Dim dv As DrawingVisual = New DrawingVisual()
    Using dc As DrawingContext = dv.RenderOpen()
       ' fill the image with a white color
       dc.DrawRectangle(Brushes.White, Nothing, New Rect(0, 0, 20, 20))
       dc.DrawEllipse(Brushes.Red, Nothing, New System.Windows.Point(10, 10), 10, 10)
       dc.DrawLine(New Pen(Brushes.Blue, 2), New System.Windows.Point(0, 0), New System.Windows.Point(20, 20))
       dc.DrawLine(New Pen(Brushes.Blue, 2), New System.Windows.Point(20, 0), New System.Windows.Point(0, 20))
       dc.Close()

       Dim bmp As RenderTargetBitmap = New RenderTargetBitmap(24, 24, 96, 96, PixelFormats.Pbgra32)
       bmp.Render(dv)
       ' create an annotation picture for this image, use white as the transparent color
       Dim pic As AnnPicture = New AnnPicture(bmp)
       pic.TransparentMode = AnnPictureTransparentMode.UseColor
       pic.TransparentColor = Colors.White

       ' use this picture to draw all locked objects in this container
       container.LockPicture = pic
    End Using
 End Sub
C#Copy Code
public void AnnContainer_LockPicture(AnnContainer container) 

   // we are going to create a new lock image that is 20 by 20 red ellipse with a blue cross inside it. 
   DrawingVisual dv = new DrawingVisual(); 
   using(DrawingContext dc = dv.RenderOpen()) 
   { 
      // fill the image with a white color 
      dc.DrawRectangle(Brushes.White, null, new Rect(0, 0, 20, 20)); 
      dc.DrawEllipse(Brushes.Red, null, new Point(10, 10), 10, 10); 
      dc.DrawLine(new Pen(Brushes.Blue, 2), new Point(0, 0), new Point(20, 20)); 
      dc.DrawLine(new Pen(Brushes.Blue, 2), new Point(20, 0), new Point(0, 20)); 
      dc.Close(); 
 
      RenderTargetBitmap bmp = new RenderTargetBitmap(24, 24, 96, 96, PixelFormats.Pbgra32); 
      bmp.Render(dv); 
      // create an annotation picture for this image, use white as the transparent color 
      AnnPicture pic = new AnnPicture(bmp); 
      pic.TransparentMode = AnnPictureTransparentMode.UseColor; 
      pic.TransparentColor = Colors.White; 
 
      // use this picture to draw all locked objects in this container 
      container.LockPicture = pic; 
   } 
}

Remarks

All objects inside the container will use this picture when drawing the object if the object is locked.

The container uses a picture of a "lock" that is created by default. You can change this default picture by using this property.

For more information, refer to Implementing WPF Annotation Security.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also

LockPicture requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.