LEADTOOLS Support
General
General Questions
Freehand Drawing in Image processing toolkit?
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, July 8, 2012 9:15:34 PM(UTC)
Groups: Registered
Posts: 34
Hi,
Is there a freehand drawing property in the IMage processing toolkit? if so, how is it done?
Thanks a lot
bnvelarde attached the following image(s):
#2
Posted
:
Monday, July 9, 2012 5:42:38 AM(UTC)
Groups: Registered
Posts: 256
Do you mean you want to enable the user to modify the image by drawing on its pixels using the mouse?
If yes, please tell me which LEADTOOLS version (16, 17, etc.) and programming interface (Main OCX, .NET classes, DLL API, C++ Classes, etc.) you are using.
#3
Posted
:
Wednesday, July 11, 2012 8:17:50 PM(UTC)
Groups: Registered
Posts: 34
yes please.
I am using Leadtools 17.5 and vb.net.
#4
Posted
:
Thursday, July 12, 2012 6:19:32 AM(UTC)
Groups: Registered
Posts: 256
Bernadette,
One way of doing that is to handle the mouse events (mouse down, mouse move, etc.) and use GDI drawing function of .NET to modify the image pixels.
The following forum post has a VB.NET project that draws lines on an image. Although it only draws lines, you can modify the mouse events handlers so that they perform freehand drawing:
http://support.leadtools.com/SupportPortal/cs/forums/21209/ShowPost.aspx
#5
Posted
:
Wednesday, July 18, 2012 10:36:39 PM(UTC)
Groups: Registered
Posts: 34
Hi,
Referring to the link you gave me, what is the difference when I check the UseDPI??
what is DPI?
Thank you :)
#6
Posted
:
Friday, July 20, 2012 6:48:14 AM(UTC)
Groups: Tech Support
Posts: 366
Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)
Hello,
DPI = Dots Per Inch
This is a value representing the resolution of the display device, or the number of pixels that can be fit within a square inch.
With UseDPI, we account for the resolution defined with the image to make sure it displays properly on the screen.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
#7
Posted
:
Wednesday, August 15, 2012 7:44:50 PM(UTC)
Groups: Registered
Posts: 34
Hi,
I already got how to do the Freehand Drawing with the RasterImageViewer but I got a problem.
Once I scroll the image and draw, the line is not drawn in the exact position of the mouse.
Thanks for you help.
#8
Posted
:
Thursday, August 16, 2012 3:14:44 AM(UTC)
Groups: Registered
Posts: 256
I tested using the same project I created for you earlier (VB_v175_UseDpi_GDI) but was unable to reproduce the issue.
In that project, I performed drawing while zooming and scrolling, and it always drew the lines in the correct location.
Try to compare your coordinate conversion code to that project. If you still can't find the cause of the problem, please provide me with exact steps to reproduce the issue and if possible a small test project (NOT your full application) that shows the problem.
#9
Posted
:
Wednesday, August 22, 2012 6:44:00 PM(UTC)
Groups: Registered
Posts: 34
Here is my test project.
Thanks a lot
#10
Posted
:
Wednesday, August 22, 2012 6:47:41 PM(UTC)
Groups: Registered
Posts: 34
And this is the image i've been testing on my test project
thank you
File Attachment(s):
tree.jpg (1,330kb) downloaded 38 time(s).
#11
Posted
:
Thursday, August 23, 2012 5:48:11 AM(UTC)
Groups: Registered
Posts: 256
Bernadette,
The problem with your code was that it did not convert the viewer's co-ordinates to the bitmap's co-ordinates.
I have modified your project to convert from the viewer's to the bitmap's co-ordinates. Please take a look and see how this is done.
What I did was that I used RasterImageViewer.ViewerToImagePoint() function to translate the mouse co-ordinates on the viewer to their equivalent on the bitmap and then assigning the new co-ordinates back to the viewer.
Note: You can find 'DDB next to the lines I changed/Added
LEADTOOLS Support
General
General Questions
Freehand Drawing in Image processing toolkit?
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.