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
83a66a98
Commit
83a66a98
authored
Nov 01, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 01, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imagelist: Move Nx1 assumptions about bitmaps dimensions into a single function.
parent
14dda0f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
imagelist.c
dlls/comctl32/imagelist.c
+25
-10
No files found.
dlls/comctl32/imagelist.c
View file @
83a66a98
...
@@ -90,6 +90,12 @@ static inline void imagelist_point_from_index( HIMAGELIST himl, UINT index, LPPO
...
@@ -90,6 +90,12 @@ static inline void imagelist_point_from_index( HIMAGELIST himl, UINT index, LPPO
pt
->
y
=
0
;
pt
->
y
=
0
;
}
}
static
inline
void
imagelist_get_bitmap_size
(
HIMAGELIST
himl
,
UINT
count
,
UINT
cy
,
SIZE
*
sz
)
{
sz
->
cx
=
count
*
himl
->
cx
;
sz
->
cy
=
cy
;
}
/*************************************************************************
/*************************************************************************
* IMAGELIST_InternalExpandBitmaps [Internal]
* IMAGELIST_InternalExpandBitmaps [Internal]
*
*
...
@@ -111,6 +117,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
...
@@ -111,6 +117,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
HDC
hdcBitmap
;
HDC
hdcBitmap
;
HBITMAP
hbmNewBitmap
,
hbmNull
;
HBITMAP
hbmNewBitmap
,
hbmNull
;
INT
nNewWidth
,
nNewCount
;
INT
nNewWidth
,
nNewCount
;
SIZE
sz
;
if
((
himl
->
cCurImage
+
nImageCount
<=
himl
->
cMaxImage
)
if
((
himl
->
cCurImage
+
nImageCount
<=
himl
->
cMaxImage
)
&&
(
himl
->
cy
>=
cy
))
&&
(
himl
->
cy
>=
cy
))
...
@@ -128,10 +135,12 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
...
@@ -128,10 +135,12 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
if
(
hbmNewBitmap
==
0
)
if
(
hbmNewBitmap
==
0
)
ERR
(
"creating new image bitmap (x=%d y=%d)!
\n
"
,
nNewWidth
,
cy
);
ERR
(
"creating new image bitmap (x=%d y=%d)!
\n
"
,
nNewWidth
,
cy
);
if
(
himl
->
cCurImage
)
imagelist_get_bitmap_size
(
himl
,
nNewCount
,
cy
,
&
sz
);
if
(
himl
->
cCurImage
)
{
{
hbmNull
=
SelectObject
(
hdcBitmap
,
hbmNewBitmap
);
hbmNull
=
SelectObject
(
hdcBitmap
,
hbmNewBitmap
);
BitBlt
(
hdcBitmap
,
0
,
0
,
himl
->
cCurImage
*
himl
->
cx
,
cy
,
BitBlt
(
hdcBitmap
,
0
,
0
,
sz
.
cx
,
sz
.
cy
,
himl
->
hdcImage
,
0
,
0
,
SRCCOPY
);
himl
->
hdcImage
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hdcBitmap
,
hbmNull
);
SelectObject
(
hdcBitmap
,
hbmNull
);
}
}
...
@@ -149,7 +158,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
...
@@ -149,7 +158,7 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
if
(
himl
->
cCurImage
)
if
(
himl
->
cCurImage
)
{
{
hbmNull
=
SelectObject
(
hdcBitmap
,
hbmNewBitmap
);
hbmNull
=
SelectObject
(
hdcBitmap
,
hbmNewBitmap
);
BitBlt
(
hdcBitmap
,
0
,
0
,
himl
->
cCurImage
*
himl
->
cx
,
cy
,
BitBlt
(
hdcBitmap
,
0
,
0
,
sz
.
cx
,
sz
.
cy
,
himl
->
hdcMask
,
0
,
0
,
SRCCOPY
);
himl
->
hdcMask
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hdcBitmap
,
hbmNull
);
SelectObject
(
hdcBitmap
,
hbmNull
);
}
}
...
@@ -617,9 +626,10 @@ ImageList_Create (INT cx, INT cy, UINT flags,
...
@@ -617,9 +626,10 @@ ImageList_Create (INT cx, INT cy, UINT flags,
himl
->
hbmImage
=
0
;
himl
->
hbmImage
=
0
;
if
((
himl
->
cMaxImage
>
0
)
&&
(
himl
->
flags
&
ILC_MASK
))
{
if
((
himl
->
cMaxImage
>
0
)
&&
(
himl
->
flags
&
ILC_MASK
))
{
himl
->
hbmMask
=
SIZE
sz
;
CreateBitmap
(
himl
->
cx
*
himl
->
cMaxImage
,
himl
->
cy
,
1
,
1
,
NULL
);
imagelist_get_bitmap_size
(
himl
,
himl
->
cMaxImage
,
himl
->
cy
,
&
sz
);
himl
->
hbmMask
=
CreateBitmap
(
sz
.
cx
,
sz
.
cy
,
1
,
1
,
NULL
);
if
(
himl
->
hbmMask
==
0
)
{
if
(
himl
->
hbmMask
==
0
)
{
ERR
(
"Error creating mask bitmap!
\n
"
);
ERR
(
"Error creating mask bitmap!
\n
"
);
goto
cleanup
;
goto
cleanup
;
...
@@ -1275,11 +1285,14 @@ ImageList_Duplicate (HIMAGELIST himlSrc)
...
@@ -1275,11 +1285,14 @@ ImageList_Duplicate (HIMAGELIST himlSrc)
if
(
himlDst
)
if
(
himlDst
)
{
{
BitBlt
(
himlDst
->
hdcImage
,
0
,
0
,
himlSrc
->
cCurImage
*
himlSrc
->
cx
,
himlSrc
->
cy
,
SIZE
sz
;
imagelist_get_bitmap_size
(
himlSrc
,
himlSrc
->
cCurImage
,
himlSrc
->
cy
,
&
sz
);
BitBlt
(
himlDst
->
hdcImage
,
0
,
0
,
sz
.
cx
,
sz
.
cy
,
himlSrc
->
hdcImage
,
0
,
0
,
SRCCOPY
);
himlSrc
->
hdcImage
,
0
,
0
,
SRCCOPY
);
if
(
himlDst
->
hbmMask
)
if
(
himlDst
->
hbmMask
)
BitBlt
(
himlDst
->
hdcMask
,
0
,
0
,
himlSrc
->
cCurImage
*
himlSrc
->
cx
,
himlSrc
->
cy
,
BitBlt
(
himlDst
->
hdcMask
,
0
,
0
,
sz
.
cx
,
sz
.
cy
,
himlSrc
->
hdcMask
,
0
,
0
,
SRCCOPY
);
himlSrc
->
hdcMask
,
0
,
0
,
SRCCOPY
);
himlDst
->
cCurImage
=
himlSrc
->
cCurImage
;
himlDst
->
cCurImage
=
himlSrc
->
cCurImage
;
...
@@ -2079,8 +2092,10 @@ ImageList_Remove (HIMAGELIST himl, INT i)
...
@@ -2079,8 +2092,10 @@ ImageList_Remove (HIMAGELIST himl, INT i)
himl
->
hbmImage
=
hbmNewImage
;
himl
->
hbmImage
=
hbmNewImage
;
if
(
himl
->
hbmMask
)
{
if
(
himl
->
hbmMask
)
{
hbmNewMask
=
CreateBitmap
(
himl
->
cMaxImage
*
himl
->
cx
,
himl
->
cy
,
SIZE
sz
;
1
,
1
,
NULL
);
imagelist_get_bitmap_size
(
himl
,
himl
->
cMaxImage
,
himl
->
cy
,
&
sz
);
hbmNewMask
=
CreateBitmap
(
sz
.
cx
,
sz
.
cy
,
1
,
1
,
NULL
);
SelectObject
(
himl
->
hdcMask
,
hbmNewMask
);
SelectObject
(
himl
->
hdcMask
,
hbmNewMask
);
DeleteObject
(
himl
->
hbmMask
);
DeleteObject
(
himl
->
hbmMask
);
himl
->
hbmMask
=
hbmNewMask
;
himl
->
hbmMask
=
hbmNewMask
;
...
...
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