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
2dbc3980
Commit
2dbc3980
authored
May 08, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
May 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipCreateHICONFromBitmap.
parent
f279b0cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
2 deletions
+49
-2
image.c
dlls/gdiplus/image.c
+49
-2
No files found.
dlls/gdiplus/image.c
View file @
2dbc3980
...
...
@@ -1804,9 +1804,56 @@ GpStatus WINGDIPAPI GdipCreateCachedBitmap(GpBitmap *bitmap, GpGraphics *graphic
GpStatus
WINGDIPAPI
GdipCreateHICONFromBitmap
(
GpBitmap
*
bitmap
,
HICON
*
hicon
)
{
FIXME
(
"(%p, %p)
\n
"
,
bitmap
,
hicon
);
GpStatus
stat
;
BitmapData
lockeddata
;
ULONG
andstride
,
xorstride
,
bitssize
;
LPBYTE
andbits
,
xorbits
,
androw
,
xorrow
,
srcrow
;
UINT
x
,
y
;
return
NotImplemented
;
TRACE
(
"(%p, %p)
\n
"
,
bitmap
,
hicon
);
if
(
!
bitmap
||
!
hicon
)
return
InvalidParameter
;
stat
=
GdipBitmapLockBits
(
bitmap
,
NULL
,
ImageLockModeRead
,
PixelFormat32bppPARGB
,
&
lockeddata
);
if
(
stat
==
Ok
)
{
andstride
=
((
lockeddata
.
Width
+
31
)
/
32
)
*
4
;
xorstride
=
lockeddata
.
Width
*
4
;
bitssize
=
(
andstride
+
xorstride
)
*
lockeddata
.
Height
;
andbits
=
GdipAlloc
(
bitssize
);
if
(
andbits
)
{
xorbits
=
andbits
+
andstride
*
lockeddata
.
Height
;
for
(
y
=
0
;
y
<
lockeddata
.
Height
;
y
++
)
{
srcrow
=
((
LPBYTE
)
lockeddata
.
Scan0
)
+
lockeddata
.
Stride
*
y
;
androw
=
andbits
+
andstride
*
y
;
for
(
x
=
0
;
x
<
lockeddata
.
Width
;
x
++
)
if
(
srcrow
[
3
+
4
*
x
]
>=
128
)
androw
[
x
/
8
]
|=
1
<<
(
7
-
x
%
8
);
xorrow
=
xorbits
+
xorstride
*
y
;
memcpy
(
xorrow
,
srcrow
,
xorstride
);
}
*
hicon
=
CreateIcon
(
NULL
,
lockeddata
.
Width
,
lockeddata
.
Height
,
1
,
32
,
andbits
,
xorbits
);
GdipFree
(
andbits
);
}
else
stat
=
OutOfMemory
;
GdipBitmapUnlockBits
(
bitmap
,
&
lockeddata
);
}
return
stat
;
}
GpStatus
WINGDIPAPI
GdipDeleteCachedBitmap
(
GpCachedBitmap
*
cachedbmp
)
...
...
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