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
8dafdd0a
Commit
8dafdd0a
authored
Nov 19, 2013
by
Vincent Povirk
Committed by
Alexandre Julliard
Nov 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Use alpha options in CreateBitmapFromHBITMAP.
parent
48ae4314
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
1 deletion
+49
-1
imgfactory.c
dlls/windowscodecs/imgfactory.c
+14
-1
bitmap.c
dlls/windowscodecs/tests/bitmap.c
+35
-0
No files found.
dlls/windowscodecs/imgfactory.c
View file @
8dafdd0a
...
...
@@ -687,7 +687,20 @@ static HRESULT WINAPI ComponentFactory_CreateBitmapFromHBITMAP(IWICComponentFact
format
=
GUID_WICPixelFormat24bppBGR
;
break
;
case
32
:
format
=
GUID_WICPixelFormat32bppBGR
;
switch
(
option
)
{
case
WICBitmapUseAlpha
:
format
=
GUID_WICPixelFormat32bppBGRA
;
break
;
case
WICBitmapUsePremultipliedAlpha
:
format
=
GUID_WICPixelFormat32bppPBGRA
;
break
;
case
WICBitmapIgnoreAlpha
:
format
=
GUID_WICPixelFormat32bppBGR
;
break
;
default:
return
E_INVALIDARG
;
}
break
;
case
48
:
format
=
GUID_WICPixelFormat48bppRGB
;
...
...
dlls/windowscodecs/tests/bitmap.c
View file @
8dafdd0a
...
...
@@ -846,6 +846,41 @@ todo_wine
IWICBitmap_Release
(
bitmap
);
DeleteObject
(
hbmp
);
DeleteObject
(
hpal
);
/* 32bpp alpha */
hbmp
=
create_dib
(
2
,
2
,
32
,
NULL
,
NULL
);
hr
=
IWICImagingFactory_CreateBitmapFromHBITMAP
(
factory
,
hbmp
,
NULL
,
WICBitmapUseAlpha
,
&
bitmap
);
ok
(
hr
==
S_OK
,
"CreateBitmapFromHBITMAP error %#x
\n
"
,
hr
);
hr
=
IWICBitmap_GetPixelFormat
(
bitmap
,
&
format
);
ok
(
hr
==
S_OK
,
"GetPixelFormat error %#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_WICPixelFormat32bppBGRA
),
"unexpected pixel format %s
\n
"
,
debugstr_guid
(
&
format
));
IWICBitmap_Release
(
bitmap
);
/* 32bpp pre-multiplied alpha */
hr
=
IWICImagingFactory_CreateBitmapFromHBITMAP
(
factory
,
hbmp
,
NULL
,
WICBitmapUsePremultipliedAlpha
,
&
bitmap
);
ok
(
hr
==
S_OK
,
"CreateBitmapFromHBITMAP error %#x
\n
"
,
hr
);
hr
=
IWICBitmap_GetPixelFormat
(
bitmap
,
&
format
);
ok
(
hr
==
S_OK
,
"GetPixelFormat error %#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_WICPixelFormat32bppPBGRA
),
"unexpected pixel format %s
\n
"
,
debugstr_guid
(
&
format
));
IWICBitmap_Release
(
bitmap
);
/* 32bpp no alpha */
hr
=
IWICImagingFactory_CreateBitmapFromHBITMAP
(
factory
,
hbmp
,
NULL
,
WICBitmapIgnoreAlpha
,
&
bitmap
);
ok
(
hr
==
S_OK
,
"CreateBitmapFromHBITMAP error %#x
\n
"
,
hr
);
hr
=
IWICBitmap_GetPixelFormat
(
bitmap
,
&
format
);
ok
(
hr
==
S_OK
,
"GetPixelFormat error %#x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
format
,
&
GUID_WICPixelFormat32bppBGR
),
"unexpected pixel format %s
\n
"
,
debugstr_guid
(
&
format
));
IWICBitmap_Release
(
bitmap
);
DeleteObject
(
hbmp
);
}
static
void
test_clipper
(
void
)
...
...
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