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
e25dca21
Commit
e25dca21
authored
Jan 27, 2014
by
Adi Shavit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed indentation.
parent
d44e3c36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
53 deletions
+53
-53
window_w32.cpp
modules/highgui/src/window_w32.cpp
+53
-53
No files found.
modules/highgui/src/window_w32.cpp
View file @
e25dca21
...
@@ -1287,8 +1287,8 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
...
@@ -1287,8 +1287,8 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
switch
(
uMsg
)
switch
(
uMsg
)
{
{
case
WM_COPY
:
case
WM_COPY
:
::
WindowProc
(
hwnd
,
uMsg
,
wParam
,
lParam
);
// call highgui proc. There may be a better way to do this.
::
WindowProc
(
hwnd
,
uMsg
,
wParam
,
lParam
);
// call highgui proc. There may be a better way to do this.
break
;
break
;
case
WM_DESTROY
:
case
WM_DESTROY
:
...
@@ -1465,57 +1465,57 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
...
@@ -1465,57 +1465,57 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
// Upon any error we can jump out of the single-time while scope to clean up the resources.
// Upon any error we can jump out of the single-time while scope to clean up the resources.
do
do
{
{
if
(
!::
EmptyClipboard
())
if
(
!::
EmptyClipboard
())
break
;
break
;
if
(
!
window
->
image
)
if
(
!
window
->
image
)
break
;
break
;
// Get window device context
// Get window device context
if
(
0
==
(
hDC
=
::
GetDC
(
hwnd
)))
if
(
0
==
(
hDC
=
::
GetDC
(
hwnd
)))
break
;
break
;
// Create another DC compatible with hDC
// Create another DC compatible with hDC
if
(
0
==
(
memDC
=
::
CreateCompatibleDC
(
hDC
)))
if
(
0
==
(
memDC
=
::
CreateCompatibleDC
(
hDC
)))
break
;
break
;
// Determine the bitmap's dimensions
// Determine the bitmap's dimensions
int
nchannels
=
3
;
int
nchannels
=
3
;
SIZE
size
=
{
0
,
0
};
SIZE
size
=
{
0
,
0
};
icvGetBitmapData
(
window
,
&
size
,
&
nchannels
,
0
);
icvGetBitmapData
(
window
,
&
size
,
&
nchannels
,
0
);
// Create bitmap to draw on and it in the new DC
// Create bitmap to draw on and it in the new DC
if
(
0
==
(
memBM
=
::
CreateCompatibleBitmap
(
hDC
,
size
.
cx
,
size
.
cy
)))
if
(
0
==
(
memBM
=
::
CreateCompatibleBitmap
(
hDC
,
size
.
cx
,
size
.
cy
)))
break
;
break
;
if
(
!::
SelectObject
(
memDC
,
memBM
))
if
(
!::
SelectObject
(
memDC
,
memBM
))
break
;
break
;
// Begin drawing to DC
// Begin drawing to DC
if
(
!::
SetStretchBltMode
(
memDC
,
COLORONCOLOR
))
if
(
!::
SetStretchBltMode
(
memDC
,
COLORONCOLOR
))
break
;
break
;
RGBQUAD
table
[
256
];
RGBQUAD
table
[
256
];
if
(
1
==
nchannels
)
if
(
1
==
nchannels
)
{
{
for
(
int
i
=
0
;
i
<
256
;
++
i
)
for
(
int
i
=
0
;
i
<
256
;
++
i
)
{
{
table
[
i
].
rgbBlue
=
(
unsigned
char
)
i
;
table
[
i
].
rgbBlue
=
(
unsigned
char
)
i
;
table
[
i
].
rgbGreen
=
(
unsigned
char
)
i
;
table
[
i
].
rgbGreen
=
(
unsigned
char
)
i
;
table
[
i
].
rgbRed
=
(
unsigned
char
)
i
;
table
[
i
].
rgbRed
=
(
unsigned
char
)
i
;
}
}
if
(
!::
SetDIBColorTable
(
window
->
dc
,
0
,
255
,
table
))
if
(
!::
SetDIBColorTable
(
window
->
dc
,
0
,
255
,
table
))
break
;
break
;
}
}
// The image copied to the clipboard will be in its original size, regardless if the window itself was resized.
// The image copied to the clipboard will be in its original size, regardless if the window itself was resized.
// Render the image to the dc/bitmap (at original size).
// Render the image to the dc/bitmap (at original size).
if
(
!::
BitBlt
(
memDC
,
0
,
0
,
size
.
cx
,
size
.
cy
,
window
->
dc
,
0
,
0
,
SRCCOPY
))
if
(
!::
BitBlt
(
memDC
,
0
,
0
,
size
.
cx
,
size
.
cy
,
window
->
dc
,
0
,
0
,
SRCCOPY
))
break
;
break
;
// Finally, set bitmap to clipboard
// Finally, set bitmap to clipboard
::
SetClipboardData
(
CF_BITMAP
,
memBM
);
::
SetClipboardData
(
CF_BITMAP
,
memBM
);
}
while
(
0
,
0
);
// (0,0) instead of (0) to avoid MSVC compiler warning C4127: "conditional expression is constant"
}
while
(
0
,
0
);
// (0,0) instead of (0) to avoid MSVC compiler warning C4127: "conditional expression is constant"
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
...
...
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