Gets or sets the
AnnPicture used when drawing the locked symbol for locked objects.
Syntax
Visual Basic (Declaration) | |
---|
Public Overridable Property LockPicture As AnnPicture |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As AnnContainer
Dim value As AnnPicture
instance.LockPicture = value
value = instance.LockPicture
|
C# | |
---|
public virtual AnnPicture LockPicture {get; set;} |
Return Value
The
AnnPicture used when drawing the locked symbol for locked objects.
Example
Visual Basic | Copy Code |
---|
Public Sub AnnContainer_LockPicture(ByVal container As AnnContainer)
Dim btmp As Bitmap = New Bitmap(20, 20, PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(btmp)
Try
g.FillRectangle(Brushes.White, New Rectangle(0, 0, 20, 20))
g.FillEllipse(Brushes.Red, New Rectangle(0, 0, 20, 20))
g.DrawLine(Pens.Blue, 0, 0, 20, 20)
g.DrawLine(Pens.Blue, 20, 0, 0, 20)
Finally
CType(g, IDisposable).Dispose()
End Try
Dim pic As AnnPicture = New AnnPicture(btmp)
pic.TransparentMode = AnnPictureTransparentMode.UseColor
pic.TransparentColor = Color.White
container.LockPicture = pic
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. Bitmap btmp = new Bitmap(20, 20, PixelFormat.Format32bppArgb); using (Graphics graphics = Graphics.FromImage(btmp)) { // fill the image with a white color graphics.FillRectangle(Brushes.White, new Rectangle(0, 0, 20, 20)); graphics.FillEllipse(Brushes.Red, new Rectangle(0, 0, 20, 20)); graphics.DrawLine(Pens.Blue, 0, 0, 20, 20); graphics.DrawLine(Pens.Blue, 20, 0, 0, 20); } // create an annotation picture for this image, use white as the transparent color AnnPicture pic = new AnnPicture(btmp); pic.TransparentMode = AnnPictureTransparentMode.UseColor; pic.TransparentColor = Color.White; // use this picture to draw all locked objects in this container container.LockPicture = pic; } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also