Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d8379a64
Commit
d8379a64
authored
Apr 01, 1999
by
Ulrich Weigand
Committed by
Alexandre Julliard
Apr 01, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LoadBitmap16()/LoadImage16() calling sequence simplified.
parent
6903156e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
94 deletions
+23
-94
bitmap.h
include/bitmap.h
+1
-2
bitmap.c
objects/bitmap.c
+22
-92
No files found.
include/bitmap.h
View file @
d8379a64
...
...
@@ -50,8 +50,7 @@ extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer )
extern
INT
BITMAP_GetObject
(
BITMAPOBJ
*
bmp
,
INT
count
,
LPVOID
buffer
);
extern
BOOL
BITMAP_DeleteObject
(
HBITMAP16
hbitmap
,
BITMAPOBJ
*
bitmap
);
extern
INT
BITMAP_GetWidthBytes
(
INT
width
,
INT
depth
);
extern
HBITMAP
BITMAP_LoadBitmapW
(
HINSTANCE
instance
,
LPCWSTR
name
,
UINT
loadflags
);
extern
HBITMAP
BITMAP_Load
(
HINSTANCE
instance
,
LPCWSTR
name
,
UINT
loadflags
);
extern
HBITMAP
BITMAP_CopyBitmap
(
HBITMAP
hbitmap
);
/* objects/dib.c */
...
...
objects/bitmap.c
View file @
d8379a64
...
...
@@ -408,27 +408,13 @@ LONG WINAPI SetBitmapBits(
HANDLE16
WINAPI
LoadImage16
(
HINSTANCE16
hinst
,
LPCSTR
name
,
UINT16
type
,
INT16
desiredx
,
INT16
desiredy
,
UINT16
loadflags
)
{
if
(
HIWORD
(
name
))
{
TRACE
(
resource
,
"(0x%04x,%s,%d,%d,%d,0x%08x)
\n
"
,
hinst
,(
char
*
)
PTR_SEG_TO_LIN
(
name
),
type
,
desiredx
,
desiredy
,
loadflags
);
}
else
{
TRACE
(
resource
,
"LoadImage16(0x%04x,%p,%d,%d,%d,0x%08x)
\n
"
,
hinst
,
name
,
type
,
desiredx
,
desiredy
,
loadflags
);
}
switch
(
type
)
{
case
IMAGE_BITMAP
:
return
LoadBitmap16
(
hinst
,(
SEGPTR
)
name
);
case
IMAGE_ICON
:
return
LoadIcon16
(
hinst
,(
SEGPTR
)
name
);
case
IMAGE_CURSOR
:
return
LoadCursor16
(
hinst
,(
SEGPTR
)
name
);
}
return
0
;
LPCSTR
nameStr
=
HIWORD
(
name
)
?
PTR_SEG_TO_LIN
(
name
)
:
(
LPCSTR
)
name
;
return
LoadImageA
(
hinst
,
nameStr
,
type
,
desiredx
,
desiredy
,
loadflags
);
}
/**********************************************************************
* LoadImage
32
A (USER32.365)
* LoadImageA (USER32.365)
*
* FIXME: implementation lacks some features, see LR_ defines in windows.h
*/
...
...
@@ -448,7 +434,7 @@ HANDLE WINAPI LoadImageA( HINSTANCE hinst, LPCSTR name, UINT type,
/******************************************************************************
* LoadImage
32
W [USER32.366] Loads an icon, cursor, or bitmap
* LoadImageW [USER32.366] Loads an icon, cursor, or bitmap
*
* PARAMS
* hinst [I] Handle of instance that contains image
...
...
@@ -486,7 +472,7 @@ HANDLE WINAPI LoadImageW( HINSTANCE hinst, LPCWSTR name, UINT type,
if
(
loadflags
&
LR_LOADFROMFILE
)
loadflags
&=
~
LR_SHARED
;
switch
(
type
)
{
case
IMAGE_BITMAP
:
return
BITMAP_Load
BitmapW
(
hinst
,
name
,
loadflags
);
return
BITMAP_Load
(
hinst
,
name
,
loadflags
);
case
IMAGE_ICON
:
{
...
...
@@ -578,66 +564,9 @@ HICON WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
}
/**********************************************************************
* LoadBitmap16 (USER.175)
*
* NOTES
* Can this call LoadBitmap32?
*/
HBITMAP16
WINAPI
LoadBitmap16
(
HINSTANCE16
instance
,
SEGPTR
name
)
{
HBITMAP
hbitmap
=
0
;
HDC
hdc
;
HRSRC16
hRsrc
;
HGLOBAL16
handle
;
BITMAPINFO
*
info
;
if
(
HIWORD
(
name
))
{
char
*
str
=
(
char
*
)
PTR_SEG_TO_LIN
(
name
);
TRACE
(
bitmap
,
"(%04x,'%s')
\n
"
,
instance
,
str
);
if
(
str
[
0
]
==
'#'
)
name
=
(
SEGPTR
)(
DWORD
)(
WORD
)
atoi
(
str
+
1
);
}
else
TRACE
(
bitmap
,
"(%04x,%04x)
\n
"
,
instance
,
LOWORD
(
name
)
);
if
(
!
instance
)
/* OEM bitmap */
{
HDC
hdc
;
DC
*
dc
;
if
(
HIWORD
((
int
)
name
))
return
0
;
hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
dc
=
DC_GetDCPtr
(
hdc
);
if
(
dc
->
funcs
->
pLoadOEMResource
)
hbitmap
=
dc
->
funcs
->
pLoadOEMResource
(
LOWORD
((
int
)
name
),
OEM_BITMAP
);
GDI_HEAP_UNLOCK
(
hdc
);
DeleteDC
(
hdc
);
return
hbitmap
;
}
if
(
!
(
hRsrc
=
FindResource16
(
instance
,
name
,
RT_BITMAP16
)))
return
0
;
if
(
!
(
handle
=
LoadResource16
(
instance
,
hRsrc
)))
return
0
;
info
=
(
BITMAPINFO
*
)
LockResource16
(
handle
);
if
((
hdc
=
GetDC
(
0
))
!=
0
)
{
char
*
bits
=
(
char
*
)
info
+
DIB_BitmapInfoSize
(
info
,
DIB_RGB_COLORS
);
hbitmap
=
CreateDIBitmap
(
hdc
,
&
info
->
bmiHeader
,
CBM_INIT
,
bits
,
info
,
DIB_RGB_COLORS
);
ReleaseDC
(
0
,
hdc
);
}
FreeResource16
(
handle
);
return
hbitmap
;
}
/**********************************************************************
* BITMAP_LoadBitmap32W
* BITMAP_Load
*/
HBITMAP
BITMAP_LoadBitmapW
(
HINSTANCE
instance
,
LPCWSTR
name
,
UINT
loadflags
)
HBITMAP
BITMAP_Load
(
HINSTANCE
instance
,
LPCWSTR
name
,
UINT
loadflags
)
{
HBITMAP
hbitmap
=
0
;
HDC
hdc
;
...
...
@@ -702,7 +631,7 @@ HBITMAP BITMAP_LoadBitmapW(HINSTANCE instance,LPCWSTR name,
/******************************************************************************
* LoadBitmap
32
W [USER32.358] Loads bitmap from the executable file
* LoadBitmapW [USER32.358] Loads bitmap from the executable file
*
* RETURNS
* Success: Handle to specified bitmap
...
...
@@ -712,26 +641,27 @@ HBITMAP WINAPI LoadBitmapW(
HINSTANCE
instance
,
/* [in] Handle to application instance */
LPCWSTR
name
)
/* [in] Address of bitmap resource name */
{
return
BITMAP_LoadBitmapW
(
instance
,
name
,
0
);
return
LoadImageW
(
instance
,
name
,
IMAGE_BITMAP
,
0
,
0
,
0
);
}
/**********************************************************************
* LoadBitmap
32
A (USER32.357)
* LoadBitmapA (USER32.357)
*/
HBITMAP
WINAPI
LoadBitmapA
(
HINSTANCE
instance
,
LPCSTR
name
)
{
HBITMAP
res
;
if
(
!
HIWORD
(
name
))
res
=
LoadBitmapW
(
instance
,
(
LPWSTR
)
name
);
else
{
LPWSTR
uni
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
name
);
res
=
LoadBitmapW
(
instance
,
uni
);
HeapFree
(
GetProcessHeap
(),
0
,
uni
);
}
return
res
;
return
LoadImageA
(
instance
,
name
,
IMAGE_BITMAP
,
0
,
0
,
0
);
}
/**********************************************************************
* LoadBitmap16 (USER.175)
*/
HBITMAP16
WINAPI
LoadBitmap16
(
HINSTANCE16
instance
,
SEGPTR
name
)
{
LPCSTR
nameStr
=
HIWORD
(
name
)
?
PTR_SEG_TO_LIN
(
name
)
:
(
LPCSTR
)
name
;
return
LoadBitmapA
(
instance
,
nameStr
);
}
/***********************************************************************
* BITMAP_DeleteObject
...
...
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