Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
deb8ba22
Commit
deb8ba22
authored
Dec 16, 2018
by
Christoph Rackwitz
Committed by
Maksim Shabunin
Dec 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for #4990: highgui w32 ogl: correct calculation of image coordinates from window coordinates
parent
7d692890
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
window_w32.cpp
modules/highgui/src/window_w32.cpp
+29
-1
No files found.
modules/highgui/src/window_w32.cpp
View file @
deb8ba22
...
...
@@ -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
=
...
...
@@ -1489,7 +1490,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
,
...
...
@@ -1683,7 +1697,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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment