Improved the image_window a bit.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402967
This commit is contained in:
Davis King 2009-03-22 18:24:59 +00:00
parent 55283b4630
commit f432c9671a
2 changed files with 22 additions and 3 deletions

View File

@ -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();

View File

@ -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(
);
/*!
@ -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 (