displayImage

A convenience function to pop up a window displaying the image. If you pass a win, it will draw the image in it. Otherwise, it will create a window with the size of the image and run its event loop, closing when a key is pressed.

Meta

History

BlockingMode parameter added on December 8, 2021. Previously, it would always block until the application quit which could cause bizarre behavior inside a more complex application. Now, the default is to block until this window closes if it is the only event loop running, and otherwise, not to block at all and just pop up the display window asynchronously.