LEADTOOLS Support
Imaging
Imaging SDK Questions
HOW TO: Find the nearest pixel of a given color (C#, WinForms)
#1
Posted
:
Tuesday, October 20, 2015 6:19:55 AM(UTC)
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.
Update: Below is an updated solution containing configurations for using LEADTOOLS 19 and LEADTOOLS 20
Edited by moderator Thursday, April 26, 2018 7:35:38 AM(UTC)
| Reason: Updated for v20
LEADTOOLS Support
Imaging
Imaging SDK Questions
HOW TO: Find the nearest pixel of a given color (C#, WinForms)
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.