Skip to content

Displaying an image in a window

Romain Milbert edited this page Sep 28, 2017 · 1 revision

ArcV supports the use of windows to display any image you want. To do so, execute the following:

Arcv::Matrix<float> mat = Arcv::Image::read("lena.png");

// This will create a window with the same size as the image. Window's name is optional
// Beware though, as the image will be stretched if window's size is different than the image's
Arcv::Window window(mat.getWidth(), mat.getHeight(), "Lena RGB");

window.mapImage(mat); // Not mapping the image will result in a black window
window.show();

A window will appear with the image you mapped within it. To close it, simply press Esc.