LEADTOOLS Annotations (Leadtools.Annotations assembly)
LEAD Technologies, Inc

PushFixedState Method (AnnContainer)

Example 





Temporarily disables the fixed state of every AnnObject in the AnnContainer.
Syntax
public virtual int PushFixedState()
'Declaration
 
Public Overridable Function PushFixedState() As Integer
'Usage
 
Dim instance As AnnContainer
Dim value As Integer
 
value = instance.PushFixedState()
public virtual int PushFixedState()
 function Leadtools.Annotations.AnnContainer.PushFixedState()
public:
virtual int PushFixedState(); 

Return Value

size of the fixed state stack before the call to PushFixedState
Remarks
Calls AnnObject.PushFixedState on all AnnObject in the AnnContainer. Fixed annotations are independent of the Transform. The result is that they do not scroll or move with the underlying image. For more information, refer to AnnObject.PushFixedState.
Example
 
' This sample paints annotations (both 'fixed' and non'fixed) at a zoom factor of 2
' on the Graphics object g
Private Sub AnnContainer_PushFixedState(ByVal graphics As Graphics, ByVal annContainer As AnnContainer)
   Dim transformContainer As Matrix = annContainer.Transform
   Dim transformOriginal As Matrix = annContainer.Transform.Clone()
   ' Temporarily disable 'fixed' annotations for painting
   annContainer.PushFixedState()

   ' Paint the container at 2x
   Dim transformZoom2x As Matrix = New Matrix(2, 0, 0, 2, 0, 0)
   transformContainer.Multiply(transformZoom2x)
   annContainer.Draw(graphics)

   ' Restore original container transform
   annContainer.Transform = transformOriginal

   ' Enable 'fixed' annotions
   annContainer.PopFixedState()
End Sub
// This sample paints annotations (both 'fixed' and non'fixed) at a zoom factor of 2
// on the Graphics object g
private void AnnContainer_PushFixedState(Graphics graphics, AnnContainer annContainer)
{
   Matrix transformContainer = annContainer.Transform;
   Matrix transformOriginal = annContainer.Transform.Clone();
   // Temporarily disable 'fixed' annotations for painting
   annContainer.PushFixedState();

   // Paint the container at 2x
   Matrix transformZoom2x = new Matrix(2, 0, 0, 2, 0, 0);
   transformContainer.Multiply(transformZoom2x);
   annContainer.Draw(graphics);

   // Restore original container transform
   annContainer.Transform = transformOriginal;

   // Enable 'fixed' annotions
   annContainer.PopFixedState();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnContainer Class
AnnContainer Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.