mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
#include <functional>
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include <GL/gl.h>
|
||||
#include "opencv2/core/opengl.hpp"
|
||||
#endif
|
||||
|
||||
static const char* trackbar_text =
|
||||
@@ -1144,20 +1145,20 @@ static void icvUpdateWindowPos( CvWindow* window )
|
||||
{
|
||||
RECT rmw, rw = icvCalcWindowRect(window );
|
||||
MoveWindow(window->hwnd, rw.left, rw.top,
|
||||
rw.right - rw.left + 1, rw.bottom - rw.top + 1, FALSE);
|
||||
rw.right - rw.left, rw.bottom - rw.top, FALSE);
|
||||
GetClientRect(window->hwnd, &rw);
|
||||
GetWindowRect(window->frame, &rmw);
|
||||
// Resize the mainhWnd window in order to make the bitmap fit into the child window
|
||||
MoveWindow(window->frame, rmw.left, rmw.top,
|
||||
rmw.right - rmw.left + size.cx - rw.right + rw.left,
|
||||
rmw.bottom - rmw.top + size.cy - rw.bottom + rw.top, TRUE );
|
||||
size.cx + (rmw.right - rmw.left) - (rw.right - rw.left),
|
||||
size.cy + (rmw.bottom - rmw.top) - (rw.bottom - rw.top), TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
rect = icvCalcWindowRect(window);
|
||||
MoveWindow(window->hwnd, rect.left, rect.top,
|
||||
rect.right - rect.left + 1,
|
||||
rect.bottom - rect.top + 1, TRUE );
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top, TRUE );
|
||||
}
|
||||
|
||||
CV_IMPL void
|
||||
@@ -1263,18 +1264,18 @@ CV_IMPL void cvResizeWindow(const char* name, int width, int height )
|
||||
{
|
||||
rw = icvCalcWindowRect(window);
|
||||
MoveWindow(window->hwnd, rw.left, rw.top,
|
||||
rw.right - rw.left + 1, rw.bottom - rw.top + 1, FALSE);
|
||||
rw.right - rw.left, rw.bottom - rw.top, FALSE);
|
||||
GetClientRect(window->hwnd, &rw);
|
||||
GetWindowRect(window->frame, &rmw);
|
||||
// Resize the mainhWnd window in order to make the bitmap fit into the child window
|
||||
MoveWindow(window->frame, rmw.left, rmw.top,
|
||||
rmw.right - rmw.left + width - rw.right + rw.left,
|
||||
rmw.bottom - rmw.top + height - rw.bottom + rw.top, TRUE);
|
||||
width + (rmw.right - rmw.left) - (rw.right - rw.left),
|
||||
height + (rmw.bottom - rmw.top) - (rw.bottom - rw.top), TRUE);
|
||||
}
|
||||
|
||||
rect = icvCalcWindowRect(window);
|
||||
MoveWindow(window->hwnd, rect.left, rect.top,
|
||||
rect.right - rect.left + 1, rect.bottom - rect.top + 1, TRUE);
|
||||
rect.right - rect.left, rect.bottom - rect.top, TRUE);
|
||||
|
||||
__END__;
|
||||
}
|
||||
@@ -1421,7 +1422,20 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
GetClientRect( window->hwnd, &rect );
|
||||
|
||||
SIZE size = {0,0};
|
||||
icvGetBitmapData( window, &size, 0, 0 );
|
||||
#ifdef HAVE_OPENGL
|
||||
if (window->useGl)
|
||||
{
|
||||
cv::ogl::Texture2D* texObj = static_cast<cv::ogl::Texture2D*>(window->glDrawData);
|
||||
size.cx = texObj->cols();
|
||||
size.cy = texObj->rows();
|
||||
}
|
||||
else
|
||||
{
|
||||
icvGetBitmapData(window, &size, 0, 0);
|
||||
}
|
||||
#else
|
||||
icvGetBitmapData(window, &size, 0, 0);
|
||||
#endif
|
||||
|
||||
window->on_mouse( event, pt.x*size.cx/MAX(rect.right - rect.left,1),
|
||||
pt.y*size.cy/MAX(rect.bottom - rect.top,1), flags,
|
||||
@@ -1561,8 +1575,8 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
|
||||
RECT rect = icvCalcWindowRect(window);
|
||||
pos->x = rect.left;
|
||||
pos->y = rect.top;
|
||||
pos->cx = rect.right - rect.left + 1;
|
||||
pos->cy = rect.bottom - rect.top + 1;
|
||||
pos->cx = rect.right - rect.left;
|
||||
pos->cy = rect.bottom - rect.top;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1615,7 +1629,21 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
|
||||
SIZE size = {0, 0};
|
||||
|
||||
GetClientRect( window->hwnd, &rect );
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
if (window->useGl)
|
||||
{
|
||||
cv::ogl::Texture2D* texObj = static_cast<cv::ogl::Texture2D*>(window->glDrawData);
|
||||
size.cx = texObj->cols();
|
||||
size.cy = texObj->rows();
|
||||
}
|
||||
else
|
||||
{
|
||||
icvGetBitmapData(window, &size, 0, 0);
|
||||
}
|
||||
#else
|
||||
icvGetBitmapData( window, &size, 0, 0 );
|
||||
#endif
|
||||
|
||||
window->on_mouse( event, pt.x*size.cx/MAX(rect.right - rect.left,1),
|
||||
pt.y*size.cy/MAX(rect.bottom - rect.top,1), flags,
|
||||
|
||||
Reference in New Issue
Block a user