Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
df78d685
Commit
df78d685
authored
Jul 25, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Jul 25, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GDI APIs to access bitmap info.
parent
1613e791
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
static.c
controls/static.c
+23
-19
No files found.
controls/static.c
View file @
df78d685
...
...
@@ -7,7 +7,6 @@
#include "wine/winuser16.h"
#include "win.h"
#include "bitmap.h"
#include "cursoricon.h"
#include "static.h"
#include "heap.h"
...
...
@@ -83,26 +82,26 @@ static HICON16 STATIC_SetIcon( WND *wndPtr, HICON16 hicon )
*
* Set the bitmap for an SS_BITMAP control.
*/
static
H
ICON16
STATIC_SetBitmap
(
WND
*
wndPtr
,
HICON16
hicon
)
static
H
BITMAP16
STATIC_SetBitmap
(
WND
*
wndPtr
,
HBITMAP16
hBitmap
)
{
H
ICON16
prevIcon
;
H
BITMAP16
hOldBitmap
;
STATICINFO
*
infoPtr
=
(
STATICINFO
*
)
wndPtr
->
wExtra
;
BITMAPOBJ
*
info
=
(
BITMAPOBJ
*
)
GDI_HEAP_LOCK
(
hicon
);
if
((
wndPtr
->
dwStyle
&
SS_TYPEMASK
)
!=
SS_BITMAP
)
return
0
;
if
(
h
icon
&&
!
info
)
{
ERR
(
"huh? h
icon!=0, but info=0???
\n
"
);
if
(
h
Bitmap
&&
GetObjectType
(
hBitmap
)
!=
OBJ_BITMAP
)
{
ERR
(
"huh? h
Bitmap!=0, but not bitmap
\n
"
);
return
0
;
}
prevIcon
=
infoPtr
->
hIcon
;
infoPtr
->
hIcon
=
h
icon
;
if
(
h
icon
)
hOldBitmap
=
infoPtr
->
hIcon
;
infoPtr
->
hIcon
=
h
Bitmap
;
if
(
h
Bitmap
)
{
SetWindowPos
(
wndPtr
->
hwndSelf
,
0
,
0
,
0
,
info
->
bitmap
.
bmWidth
,
info
->
bitmap
.
bmHeight
,
SWP_NOACTIVATE
|
SWP_NOMOVE
|
SWP_NOZORDER
);
BITMAP
bm
;
GetObjectA
(
hBitmap
,
sizeof
(
bm
),
&
bm
);
SetWindowPos
(
wndPtr
->
hwndSelf
,
0
,
0
,
0
,
bm
.
bmWidth
,
bm
.
bmHeight
,
SWP_NOACTIVATE
|
SWP_NOMOVE
|
SWP_NOZORDER
);
}
GDI_HEAP_UNLOCK
(
hicon
);
return
prevIcon
;
return
hOldBitmap
;
}
...
...
@@ -449,16 +448,21 @@ static void STATIC_PaintBitmapfn(WND *wndPtr, HDC hdc )
hbrush
=
SendMessageA
(
GetParent
(
wndPtr
->
hwndSelf
),
WM_CTLCOLORSTATIC
,
hdc
,
wndPtr
->
hwndSelf
);
FillRect
(
hdc
,
&
rc
,
hbrush
);
if
(
infoPtr
->
hIcon
)
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_HEAP_LOCK
(
infoPtr
->
hIcon
);
BITMAP
bm
;
SIZE
sz
;
if
(
!
bmp
)
return
;
if
(
GetObjectType
(
infoPtr
->
hIcon
)
!=
OBJ_BITMAP
)
return
;
if
(
!
(
hMemDC
=
CreateCompatibleDC
(
hdc
)))
return
;
oldbitmap
=
SelectObject
(
hMemDC
,
infoPtr
->
hIcon
);
BitBlt
(
hdc
,
bmp
->
size
.
cx
,
bmp
->
size
.
cy
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
hMemDC
,
0
,
0
,
SRCCOPY
);
GetObjectA
(
infoPtr
->
hIcon
,
sizeof
(
bm
),
&
bm
);
GetBitmapDimensionEx
(
infoPtr
->
hIcon
,
&
sz
);
oldbitmap
=
SelectObject
(
hMemDC
,
infoPtr
->
hIcon
);
BitBlt
(
hdc
,
sz
.
cx
,
sz
.
cy
,
bm
.
bmWidth
,
bm
.
bmHeight
,
hMemDC
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hMemDC
,
oldbitmap
);
DeleteDC
(
hMemDC
);
GDI_HEAP_UNLOCK
(
infoPtr
->
hIcon
);
}
}
...
...
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