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
fdf48f1d
Commit
fdf48f1d
authored
Aug 12, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Create utility function get_graphics_bounds.
parent
e2779dc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
12 deletions
+29
-12
graphics.c
dlls/gdiplus/graphics.c
+29
-12
No files found.
dlls/gdiplus/graphics.c
View file @
fdf48f1d
...
...
@@ -1040,6 +1040,28 @@ static GpStatus restore_container(GpGraphics* graphics,
return
Ok
;
}
static
GpStatus
get_graphics_bounds
(
GpGraphics
*
graphics
,
GpRectF
*
rect
)
{
RECT
wnd_rect
;
if
(
graphics
->
hwnd
)
{
if
(
!
GetClientRect
(
graphics
->
hwnd
,
&
wnd_rect
))
return
GenericError
;
rect
->
X
=
wnd_rect
.
left
;
rect
->
Y
=
wnd_rect
.
top
;
rect
->
Width
=
wnd_rect
.
right
-
wnd_rect
.
left
;
rect
->
Height
=
wnd_rect
.
bottom
-
wnd_rect
.
top
;
}
else
{
rect
->
X
=
0
;
rect
->
Y
=
0
;
rect
->
Width
=
GetDeviceCaps
(
graphics
->
hdc
,
HORZRES
);
rect
->
Height
=
GetDeviceCaps
(
graphics
->
hdc
,
VERTRES
);
}
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipCreateFromHDC
(
HDC
hdc
,
GpGraphics
**
graphics
)
{
TRACE
(
"(%p, %p)
\n
"
,
hdc
,
graphics
);
...
...
@@ -3120,7 +3142,7 @@ GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
{
GpSolidFill
*
brush
;
GpStatus
stat
;
RECT
rect
;
GpRectF
wnd_
rect
;
TRACE
(
"(%p, %x)
\n
"
,
graphics
,
color
);
...
...
@@ -3133,18 +3155,13 @@ GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics *graphics, ARGB color)
if
((
stat
=
GdipCreateSolidFill
(
color
,
&
brush
))
!=
Ok
)
return
stat
;
if
(
graphics
->
hwnd
){
if
(
!
GetWindowRect
(
graphics
->
hwnd
,
&
rect
)){
GdipDeleteBrush
((
GpBrush
*
)
brush
);
return
GenericError
;
}
GdipFillRectangle
(
graphics
,
(
GpBrush
*
)
brush
,
0
.
0
,
0
.
0
,
(
REAL
)(
rect
.
right
-
rect
.
left
),
(
REAL
)(
rect
.
bottom
-
rect
.
top
));
if
((
stat
=
get_graphics_bounds
(
graphics
,
&
wnd_rect
))
!=
Ok
){
GdipDeleteBrush
((
GpBrush
*
)
brush
);
return
stat
;
}
else
GdipFillRectangle
(
graphics
,
(
GpBrush
*
)
brush
,
0
.
0
,
0
.
0
,
(
REAL
)
GetDeviceCaps
(
graphics
->
hdc
,
HORZRES
)
,
(
REAL
)
GetDeviceCaps
(
graphics
->
hdc
,
VERTRES
)
);
GdipFillRectangle
(
graphics
,
(
GpBrush
*
)
brush
,
wnd_rect
.
X
,
wnd_rect
.
Y
,
wnd_rect
.
Width
,
wnd_rect
.
Height
);
GdipDeleteBrush
((
GpBrush
*
)
brush
);
...
...
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