Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
88bc3426
Commit
88bc3426
authored
15 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gdiplus: Add test for GdipCreateHBITMAPFromBitmap.
parent
e7d14d02
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/gdiplus/tests/image.c
+59
-0
59 additions, 0 deletions
dlls/gdiplus/tests/image.c
include/gdiplusflat.h
+1
-0
1 addition, 0 deletions
include/gdiplusflat.h
with
60 additions
and
0 deletions
dlls/gdiplus/tests/image.c
+
59
−
0
View file @
88bc3426
...
...
@@ -741,6 +741,64 @@ static void test_getrawformat(void)
test_bufferrawformat
((
void
*
)
jpgimage
,
sizeof
(
jpgimage
),
&
ImageFormatJPEG
,
__LINE__
,
TRUE
);
}
static
void
test_createhbitmap
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bitmap
;
HBITMAP
hbitmap
,
oldhbitmap
;
BITMAP
bm
;
int
ret
;
HDC
hdc
;
COLORREF
pixel
;
BYTE
bits
[
640
];
memset
(
bits
,
0x68
,
640
);
/* create Bitmap */
stat
=
GdipCreateBitmapFromScan0
(
10
,
20
,
32
,
PixelFormat24bppRGB
,
bits
,
&
bitmap
);
expect
(
Ok
,
stat
);
/* test NULL values */
stat
=
GdipCreateHBITMAPFromBitmap
(
NULL
,
&
hbitmap
,
0
);
todo_wine
expect
(
InvalidParameter
,
stat
);
stat
=
GdipCreateHBITMAPFromBitmap
(
bitmap
,
NULL
,
0
);
todo_wine
expect
(
InvalidParameter
,
stat
);
/* create HBITMAP */
stat
=
GdipCreateHBITMAPFromBitmap
(
bitmap
,
&
hbitmap
,
0
);
todo_wine
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
ret
=
GetObjectA
(
hbitmap
,
sizeof
(
BITMAP
),
&
bm
);
expect
(
sizeof
(
BITMAP
),
ret
);
expect
(
0
,
bm
.
bmType
);
expect
(
10
,
bm
.
bmWidth
);
expect
(
20
,
bm
.
bmHeight
);
expect
(
40
,
bm
.
bmWidthBytes
);
expect
(
1
,
bm
.
bmPlanes
);
expect
(
32
,
bm
.
bmBitsPixel
);
ok
(
bm
.
bmBits
!=
NULL
,
"got DDB, expected DIB
\n
"
);
hdc
=
CreateCompatibleDC
(
NULL
);
oldhbitmap
=
SelectObject
(
hdc
,
hbitmap
);
pixel
=
GetPixel
(
hdc
,
5
,
5
);
SelectObject
(
hdc
,
oldhbitmap
);
DeleteDC
(
hdc
);
expect
(
0x686868
,
pixel
);
DeleteObject
(
hbitmap
);
}
stat
=
GdipDisposeImage
((
GpImage
*
)
bitmap
);
expect
(
Ok
,
stat
);
}
START_TEST
(
image
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -766,6 +824,7 @@ START_TEST(image)
test_testcontrol
();
test_fromhicon
();
test_getrawformat
();
test_createhbitmap
();
GdiplusShutdown
(
gdiplusToken
);
}
This diff is collapsed.
Click to expand it.
include/gdiplusflat.h
+
1
−
0
View file @
88bc3426
...
...
@@ -59,6 +59,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
GpBitmap
**
);
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStream
(
IStream
*
,
GpBitmap
**
);
GpStatus
WINGDIPAPI
GdipCreateBitmapFromStreamICM
(
IStream
*
,
GpBitmap
**
);
GpStatus
WINGDIPAPI
GdipCreateHBITMAPFromBitmap
(
GpBitmap
*
,
HBITMAP
*
,
ARGB
);
GpStatus
WINGDIPAPI
GdipCreateHICONFromBitmap
(
GpBitmap
*
,
HICON
*
);
GpStatus
WINGDIPAPI
GdipDeleteEffect
(
CGpEffect
*
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment