Commit f432c967 authored by Davis King's avatar Davis King

Improved the image_window a bit.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402967
parent 55283b46
......@@ -3159,6 +3159,11 @@ namespace dlib
image_window(
);
template < typename image_type >
image_window(
const image_type& img
) : gui_img(*this) { set_image(img); show(); }
~image_window(
);
......@@ -3167,11 +3172,12 @@ namespace dlib
const image_type& img
)
{
const unsigned long padding = scrollable_region_style_default().get_border_size();
auto_mutex M(wm);
gui_img.set_image(img);
// set the size of this window to match the size of the input image
set_size(img.nc(),img.nr());
set_size(img.nc()+padding*2,img.nr()+padding*2);
// call this to make sure everything else is setup properly
on_window_resized();
......
......@@ -2234,6 +2234,19 @@ namespace dlib
- this object is properly initialized
!*/
template <typename image_type>
image_window(
const image_type& img
);
/*!
requires
- image_type == an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> must be defined
ensures
- this object is properly initialized
- #*this window is now displaying the given image img.
!*/
~image_window(
);
/*!
......@@ -2241,7 +2254,7 @@ namespace dlib
- any resources associated with this object have been released
!*/
template < typename image_type >
template <typename image_type>
void set_image (
const image_type& img
);
......@@ -2250,7 +2263,7 @@ namespace dlib
- image_type == an implementation of array2d/array2d_kernel_abstract.h
- pixel_traits<typename image_type::type> must be defined
ensures
- #*this window is now displaying the given image new_img.
- #*this window is now displaying the given image img.
!*/
void add_overlay (
......
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