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
a7444e8e
Commit
a7444e8e
authored
Mar 28, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use the given HPALETTE in GdipCreateBitmapFromHBITMAP.
parent
57d70bfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
10 deletions
+52
-10
image.c
dlls/gdiplus/image.c
+50
-6
image.c
dlls/gdiplus/tests/image.c
+2
-4
No files found.
dlls/gdiplus/image.c
View file @
a7444e8e
...
...
@@ -3524,12 +3524,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
if
(
!
hbm
||
!
bitmap
)
return
InvalidParameter
;
/* TODO: Support for device-dependent bitmaps */
if
(
hpal
){
FIXME
(
"no support for device-dependent bitmaps
\n
"
);
return
NotImplemented
;
}
if
(
GetObjectA
(
hbm
,
sizeof
(
bm
),
&
bm
)
!=
sizeof
(
bm
))
return
InvalidParameter
;
...
...
@@ -3626,6 +3620,56 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
GdipBitmapUnlockBits
(
*
bitmap
,
&
lockeddata
);
}
if
(
retval
==
Ok
&&
hpal
)
{
WORD
num_palette_entries
;
PALETTEENTRY
*
palette_entries
=
NULL
;
ColorPalette
*
palette
=
NULL
;
int
i
;
if
(
!
GetObjectW
(
hpal
,
sizeof
(
num_palette_entries
),
&
num_palette_entries
))
retval
=
GenericError
;
if
(
retval
==
Ok
)
{
palette_entries
=
GdipAlloc
(
sizeof
(
PALETTEENTRY
)
*
num_palette_entries
);
palette
=
GdipAlloc
(
sizeof
(
ColorPalette
)
+
sizeof
(
ARGB
)
*
(
num_palette_entries
-
1
));
if
(
!
palette_entries
||
!
palette
)
retval
=
OutOfMemory
;
}
if
(
retval
==
Ok
)
{
if
(
!
GetPaletteEntries
(
hpal
,
0
,
num_palette_entries
,
palette_entries
))
retval
=
GenericError
;
}
if
(
retval
==
Ok
)
{
palette
->
Flags
=
0
;
palette
->
Count
=
num_palette_entries
;
for
(
i
=
0
;
i
<
num_palette_entries
;
i
++
)
{
PALETTEENTRY
*
entry
=
&
palette_entries
[
i
];
palette
->
Entries
[
i
]
=
0xff000000
|
entry
->
peRed
<<
16
|
entry
->
peGreen
<<
8
|
entry
->
peBlue
;
}
retval
=
GdipSetImagePalette
((
GpImage
*
)
*
bitmap
,
palette
);
}
GdipFree
(
palette_entries
);
GdipFree
(
palette
);
}
if
(
retval
!=
Ok
)
{
GdipDisposeImage
((
GpImage
*
)
*
bitmap
);
*
bitmap
=
NULL
;
}
}
return
retval
;
...
...
dlls/gdiplus/tests/image.c
View file @
a7444e8e
...
...
@@ -917,10 +917,8 @@ static void test_GdipCreateBitmapFromHBITMAP(void)
GdipFree
(
LogPal
);
stat
=
GdipCreateBitmapFromHBITMAP
(
hbm
,
hpal
,
&
gpbm
);
todo_wine
{
expect
(
Ok
,
stat
);
}
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
GdipDisposeImage
((
GpImage
*
)
gpbm
);
...
...
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