mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
SvgArc example
git-svn-id: svn://ultimatepp.org/upp/trunk@862 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8445ecc790
commit
511dc40a45
2 changed files with 40 additions and 0 deletions
|
|
@ -4,6 +4,13 @@ void Arc(Painter& sw)
|
|||
{
|
||||
sw.Move(400, 200).Arc(400, 200, 200, 100, 0.0, M_PI).Stroke(4, Blue());
|
||||
sw.Move(400, 400).Arc(400, 400, 100, 100, 0.0, M_PI / 3).Fill(LtCyan()).Stroke(2, Black());
|
||||
sw.Path(
|
||||
"M600,350 l 50,-25 "
|
||||
"a25,25 -30 0,1 50,-25 l 50,-25 "
|
||||
"a25,50 -30 0,1 50,-25 l 50,-25 "
|
||||
"a25,75 -30 0,1 50,-25 l 50,-25 "
|
||||
"a25,100 -30 0,1 50,-25 l 50,-25"
|
||||
).Stroke(5, Red());
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
|
|
|
|||
|
|
@ -187,3 +187,36 @@ GUI_APP_MAIN
|
|||
{
|
||||
App().Run();
|
||||
}
|
||||
|
||||
/*
|
||||
struct RGBFiller {
|
||||
int a;
|
||||
byte rgb[3];
|
||||
int i;
|
||||
byte *t;
|
||||
int v[5];
|
||||
int n;
|
||||
|
||||
void Flush() {
|
||||
*t = v[0] *
|
||||
int add = 1 + ((((uintptr_t)t) >> 1) & 1);
|
||||
t += add;
|
||||
i = (i + add) & 3;
|
||||
}
|
||||
|
||||
void Finish() {
|
||||
Flush(); Flush(); Flush();
|
||||
}
|
||||
|
||||
virtual void Render(int val) {
|
||||
int v1 = (7 * val) >> 6;
|
||||
v[0] += v1;
|
||||
v[1] += 2 * v1;
|
||||
v[2] += val - 6 * v1;
|
||||
v[3] += 2 * v1;
|
||||
v[4] += v1;
|
||||
if(++n > 3)
|
||||
Flush();
|
||||
}
|
||||
};
|
||||
*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue