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
72ab72c5
Commit
72ab72c5
authored
Jun 18, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jun 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipDrawPie/GdipFillPie.
parent
8a9f817f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
2 deletions
+68
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
graphics.c
dlls/gdiplus/graphics.c
+65
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
72ab72c5
...
...
@@ -179,7 +179,7 @@
@ stub GdipDrawLines
@ stub GdipDrawLinesI
@ stub GdipDrawPath
@ st
ub GdipDrawPie
@ st
dcall GdipDrawPie(ptr ptr long long long long long long)
@ stub GdipDrawPieI
@ stub GdipDrawPolygon
@ stub GdipDrawPolygonI
...
...
@@ -209,7 +209,7 @@
@ stub GdipFillEllipse
@ stub GdipFillEllipseI
@ stub GdipFillPath
@ st
ub GdipFillPie
@ st
dcall GdipFillPie(ptr ptr long long long long long long)
@ stub GdipFillPieI
@ stub GdipFillPolygon2
@ stub GdipFillPolygon2I
...
...
dlls/gdiplus/graphics.c
View file @
72ab72c5
...
...
@@ -32,6 +32,51 @@ static inline INT roundr(REAL x)
return
(
INT
)
floor
(
x
+
0
.
5
);
}
static
inline
REAL
deg2rad
(
REAL
degrees
)
{
return
(
M_PI
*
2
.
0
)
*
degrees
/
360
.
0
;
}
/* Converts angle (in degrees) to x/y coordinates */
static
void
deg2xy
(
REAL
angle
,
REAL
x_0
,
REAL
y_0
,
REAL
*
x
,
REAL
*
y
)
{
REAL
radAngle
,
hypotenuse
;
radAngle
=
deg2rad
(
angle
);
hypotenuse
=
50
.
0
;
/* arbitrary */
*
x
=
x_0
+
cos
(
radAngle
)
*
hypotenuse
;
*
y
=
y_0
+
sin
(
radAngle
)
*
hypotenuse
;
}
/* GdipDrawPie/GdipFillPie helper function */
static
GpStatus
draw_pie
(
GpGraphics
*
graphics
,
HBRUSH
gdibrush
,
HPEN
gdipen
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
HGDIOBJ
old_pen
,
old_brush
;
REAL
x_0
,
y_0
,
x_1
,
y_1
,
x_2
,
y_2
;
if
(
!
graphics
)
return
InvalidParameter
;
old_pen
=
SelectObject
(
graphics
->
hdc
,
gdipen
);
old_brush
=
SelectObject
(
graphics
->
hdc
,
gdibrush
);
x_0
=
x
+
(
width
/
2
.
0
);
y_0
=
y
+
(
height
/
2
.
0
);
deg2xy
(
startAngle
+
sweepAngle
,
x_0
,
y_0
,
&
x_1
,
&
y_1
);
deg2xy
(
startAngle
,
x_0
,
y_0
,
&
x_2
,
&
y_2
);
Pie
(
graphics
->
hdc
,
roundr
(
x
),
roundr
(
y
),
roundr
(
x
+
width
),
roundr
(
y
+
height
),
roundr
(
x_1
),
roundr
(
y_1
),
roundr
(
x_2
),
roundr
(
y_2
));
SelectObject
(
graphics
->
hdc
,
old_pen
);
SelectObject
(
graphics
->
hdc
,
old_brush
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipCreateFromHDC
(
HDC
hdc
,
GpGraphics
**
graphics
)
{
if
(
hdc
==
NULL
)
...
...
@@ -106,6 +151,16 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipDrawPie
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
if
(
!
pen
)
return
InvalidParameter
;
return
draw_pie
(
graphics
,
GetStockObject
(
NULL_BRUSH
),
pen
->
gdipen
,
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
}
GpStatus
WINGDIPAPI
GdipDrawRectangleI
(
GpGraphics
*
graphics
,
GpPen
*
pen
,
INT
x
,
INT
y
,
INT
width
,
INT
height
)
{
...
...
@@ -137,3 +192,13 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipFillPie
(
GpGraphics
*
graphics
,
GpBrush
*
brush
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
{
if
(
!
brush
)
return
InvalidParameter
;
return
draw_pie
(
graphics
,
brush
->
gdibrush
,
GetStockObject
(
NULL_PEN
),
x
,
y
,
width
,
height
,
startAngle
,
sweepAngle
);
}
include/gdiplusflat.h
View file @
72ab72c5
...
...
@@ -34,6 +34,7 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *);
GpStatus
WINGDIPAPI
GdipDrawBezier
(
GpGraphics
*
,
GpPen
*
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawLineI
(
GpGraphics
*
,
GpPen
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipDrawPie
(
GpGraphics
*
,
GpPen
*
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
);
GpStatus
WINGDIPAPI
GdipDrawRectangleI
(
GpGraphics
*
,
GpPen
*
,
INT
,
INT
,
INT
,
INT
);
GpStatus
WINGDIPAPI
GdipFillPie
(
GpGraphics
*
,
GpBrush
*
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
,
REAL
);
...
...
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