This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, May 4, 2006 12:33:55 AM(UTC)
Groups: Registered
Posts: 8
Hello,
Is this scenario possible in Leadtools 14.5 NET?
1. Select AnnText object from toolbar
2. Click on image (standard property dialog should not display, but user can type some text directly on image)
Any ideas?
Best Regards,
Przemyslaw Gawron
#2
Posted
:
Sunday, May 7, 2006 5:05:44 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
Przemyslaw,
To override the default behavior, see the following post which describes how to use the AnnAutomationManager to disable the dialog box:
http://support.leadtools.com/SupportPortal/cs/forums/4693/ShowPost.aspx
You will need to provide an alternative method of entering the text, such as creating a text box dynamically.
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Monday, May 8, 2006 4:41:50 AM(UTC)
Groups: Registered
Posts: 8
Hello,
Thanks for reply. Creating dynamic text boxes on image seems to be a little bit difficult. However I observed that funcionality I need is implemented in ActiveX version of LEADTools (when I add some AnnText I can type directly on image). Why this thing was changed?
Best Regards,
Przemyslaw Gawron
#4
Posted
:
Tuesday, May 9, 2006 11:52:30 AM(UTC)
Groups: Manager, Tech Support
Posts: 367
Was thanked: 1 time(s) in 1 post(s)
Przemyslaw,
Here's the code to do the dynamic creation of a text box. This is only a starting point, because it doesn't cover different cases such as image zooming or scrolling, but it should be fairly easy to modify it:
'Global variable
Dim AnnTxt As AnnTextObject
'Move the text back to the Ann object if focus changes or TAB pressed:
Private Sub txt_Leave(ByVal sender As Object, ByVal e As EventArgs)
dim txt as TextBox = CType(sender, TextBox)
AnnTxt.Text = txt.Text
txt.Dispose()
End Sub
'Here's the actual code that does it, which I placed in a DoubleClick handler:
Private Sub _viewer_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)
Dim AnnPt As AnnPoint = New AnnPoint(_viewer.MousePosition.X, _viewer.MousePosition.y, AnnUnit.Pixel)
Dim x As AnnObject = Automation.Container.HitTest(AnnPt, Nothing)
If Not (x is Nothing) Then
if TypeOf(x) is AnnTextObject Then
AnnTxt = CType(x, AnnTextObject)
Dim txt as New TextBox
AddHandler txt.Leave, AddressOf txt_Leave
txt.Multiline=True
txt.Parent = _viewer
txt.Text = AnnTxt.Text
txt.SetBounds(cint(AnnTxt.Bounds.X), cint(AnnTxt.Bounds.Y), cint(AnnTxt.Bounds.Width), cint(AnnTxt.Bounds.Height))
txt.Show()
txt.Focus()
End If
End If
End Sub
Amin Dodin
Senior Support Engineer
LEAD Technologies, Inc.
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.