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 : Thursday, May 4, 2006 12:33:55 AM(UTC)
przemekg

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

 

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 : Sunday, May 7, 2006 5:05:44 AM(UTC)

Amin  
Amin

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.
LEAD Logo
 
#3 Posted : Monday, May 8, 2006 4:41:50 AM(UTC)
przemekg

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)

Amin  
Amin

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.
LEAD Logo
 
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.082 seconds.