Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 6, 2007 7:19:04 AM(UTC)

lidds  
lidds

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, November 6, 2007 11:29:32 PM(UTC)
Maen Hasan

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)

lidds  
lidds

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)
Maen Hasan

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.066 seconds.