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, October 20, 2015 6:19:55 AM(UTC)

JustinF  
Guest

Groups: Guests
Posts: 3,022

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

The attached project demonstrates how to utilize RasterImage.GetPixelColor() along with a basic Nearest Neighbor Search implementation to find the nearest pixel of a given color to the cursor.

Right click on any pixel to select a color. Then, double click anywhere on the image to snap the cursor to the nearest pixel of the selected color.

NOTE: The search algorithm is greedy. It will snap to the first-found nearest neighbor of the selected color, even if equidistant neighbors of the selected color exist.
File Attachment(s):
NearestPixelWinForms.zip (20kb) downloaded 171 time(s).

Update: Below is an updated solution containing configurations for using LEADTOOLS 19 and LEADTOOLS 20
File Attachment(s):
NearestPixelWinForms19_20.zip (15kb) downloaded 112 time(s).

Edited by moderator Thursday, April 26, 2018 7:35:38 AM(UTC)  | Reason: Updated for v20

 

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.

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.091 seconds.