ultimatepp/uppdev/PainterExamples/Clipping.cpp
cxl 5ea57805bf Developing Painter
git-svn-id: svn://ultimatepp.org/upp/trunk@851 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-02-11 20:48:27 +00:00

19 lines
461 B
C++

#include "Examples.h"
void ClippingExample(Painter& sw)
{
sw.Rectangle(0, 0, 100000, 100000).Clip();
Font fnt = Roman(150).Bold();
String txt = "CLIPPED!";
Size tsz = GetTextSize(txt, fnt);
sw.Begin();
sw.Ellipse(tsz.cx / 2, tsz.cy / 2, tsz.cx / 2, tsz.cy / 4).Clip();
sw.Text(0, 0, txt, fnt).Fill(Green());
sw.End();
sw.Text(0, 0, txt, fnt).Stroke(0.5, Black());
}
INITBLOCK {
RegisterExample("Clipping", ClippingExample);
}