This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 6, 2007 7:19:04 AM(UTC)
Groups: Registered
Posts: 9
I have been trying to find an example of how to change the default pen colour, thickness and line style. Would it be possible for you to give me some example code in vb.net on how I would do this.
Using .net class 14.5
Thanks in advance
Simon
#2
Posted
:
Tuesday, November 6, 2007 11:29:32 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
If you mean that you want to change the pen color, thickness and line style of the selected Annotation object, you can do this by changing the properties (such as AnnObj.Pen.Color, AnnObj.Pen.Width, AnnObj.Pen.DashStyle, etc.) of the currently selected Annotation object.
If you mean something else, please provide me with more details.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Wednesday, November 7, 2007 12:29:10 AM(UTC)
Groups: Registered
Posts: 9
What I want is to display on my form options so that the user is able to change the default pen colour, style and weight so that every new item placed is using the setting he has chosen. I do not want it to change existing placed elements pen colour, style or weight just new elements placed from that point onwards until the user changes it again.
Therefore allowing to have elements placed in different colours, weights etc.
Regards
Simon
#4
Posted
:
Wednesday, November 7, 2007 1:52:19 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
You can let the user select the properties (pen color, style and weight) that he wants before creating the AnnObject.
And then, during the creation of the AnnObject, change the properties of the AnnObject to the user properties.
You can do this as follows:
- Add handler for the AutomationAnn.BeforeObjectChanged Event.
- Handle the BeforeObjectChanged Event as follows:
+---+
Public Class Form1
Inherits System.Windows.Forms.Form
...
Public AutomationAnn As AnnAutomation
...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
...
AutomationAnn = New AnnAutomation(annAutomationManager, RasterImageViewer1)
' setup this automation as the active one
AutomationAnn.Active = True
...
AddHandler AutomationAnn.BeforeObjectChanged, AddressOf
automation_BeforeObjectChanged
...
End Sub
Private Sub automation_BeforeObjectChanged(ByVal sender As Object, ByVal e As AnnBeforeObjectChangedEventArgs)
If (Not IsNothing(e.Objects) AndAlso e.Objects.Count > 0) Then
e.Objects(0).Pen = New AnnPen(Color.Blue, New AnnLength(3))
End If
End Sub
+---+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.