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 : Sunday, July 8, 2012 9:20:34 PM(UTC)
bnvelarde

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):
paint properties.JPG
 

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 : Monday, July 9, 2012 5:47:38 AM(UTC)

Daoud  
Daoud

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:22:50 PM(UTC)
bnvelarde

Groups: Registered
Posts: 34


yes please.

I am using Leadtools 17.5 and vb.net.
 
#4 Posted : Thursday, July 12, 2012 6:24:32 AM(UTC)

Daoud  
Daoud

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:41:39 PM(UTC)
bnvelarde

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:53:14 AM(UTC)

Walter  
Walter

Groups: Tech Support, Administrators
Posts: 368

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.
LEAD Logo
 
#7 Posted : Wednesday, August 15, 2012 7:49:50 PM(UTC)
bnvelarde

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:19:44 AM(UTC)

Daoud  
Daoud

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:49:00 PM(UTC)
bnvelarde

Groups: Registered
Posts: 34


Here is my test project.

Thanks a lot
File Attachment(s):
testDrawing.zip (3,362kb) downloaded 28 time(s).
 
#10 Posted : Wednesday, August 22, 2012 6:52:41 PM(UTC)
bnvelarde

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 29 time(s).
 
#11 Posted : Thursday, August 23, 2012 5:53:11 AM(UTC)

Daoud  
Daoud

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

File Attachment(s):
Modified_testDrawing.zip (13kb) downloaded 28 time(s).
 
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-2019, Yet Another Forum.NET
This page was generated in 0.312 seconds.