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, July 10, 2007 5:00:02 AM(UTC)

marasma  
marasma

Groups: Registered
Posts: 51


Hi,
I'm trying to use AddMagicWandToRegion with LT15 and VB.NET, but I've some problem. When I run the command the region I get is the whole image.

I do like this:
I pick the pixel color at mouse click

then I define the lower and upper limit, using a percentage of tollerance like toller = 2%

midcolor is the color of the pixel clicked by the mouse

Dim lower As New RasterColor(midcolor.R * (1 - (toller / 100)), midcolor.G * (1 - (toller / 100)), midcolor.B * (1 - (toller / 100)))
Dim upper As New RasterColor(midcolor.R * (1 + (toller / 100)), midcolor.G * (1 + (toller / 100)), midcolor.B * (1 + (toller / 100)))
Image.AddMagicWandToRegion(ptw.X, ptw.Y, lower, upper, RasterRegionCombineMode.Set)

Where I mistake?
 

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, July 10, 2007 10:42:05 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

The region of the AddMagicWandToRegion depends on the following factors:
- The color found at point (x,y) in the image.
- The lowerToleranceColor color.
- The upperToleranceColor color.
- The image itself.

I checked the function on my side and didn't notice the problem.

Can you please send me a sample testing project that shows the problem, so that I can check it? Also, please provide me with the image that you use.

Note: If you want to send any file, please put it in a ZIP or RAR file.

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-2020, Yet Another Forum.NET
This page was generated in 0.046 seconds.