Commit a3b6df3e authored by Davis King's avatar Davis King

Added get_next_double_click() to the image_ex example.

parent 96b03e70
......@@ -69,9 +69,19 @@ int main(int argc, char** argv)
// also make a window to display the original image
image_window my_window2(img, "Original Image");
// Sometimes you want to get input from the user about which pixels are important
// for some task. You can do this easily by trapping user clicks as shown below.
// This loop executes every time the user double clicks on some image pixel and it
// will terminate once the user closes the window.
point p;
while (my_window.get_next_double_click(p))
{
cout << "User double clicked on pixel: " << p << endl;
cout << "edge pixel value at this location is: " << (int)edge_image[p.y()][p.x()] << endl;
}
// wait until the user closes the windows before we let the program
// terminate.
my_window.wait_until_closed();
win_hot.wait_until_closed();
my_window2.wait_until_closed();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment