本文整理汇总了C++中Painter::Text方法的典型用法代码示例。如果您正苦于以下问题:C++ Painter::Text方法的具体用法?C++ Painter::Text怎么用?C++ Painter::Text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Painter
的用法示例。
在下文中一共展示了Painter::Text方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Redraw
void Banner::Redraw(IntCoord x1, IntCoord y1, IntCoord x2, IntCoord y2) {
Painter* p = highlight ? inverse : output;
p->ClearRect(canvas, x1, y1, x2, y2);
if (right != nil && rx <= x2) {
p->MoveTo(rx, pad);
p->Text(canvas, right);
}
if (middle != nil && mx + mw >= x1 && mx <= x2) {
p->MoveTo(mx, pad);
p->Text(canvas, middle);
}
if (left != nil && lx + lw >= x1) {
p->MoveTo(lx, pad);
p->Text(canvas, left);
}
}
示例2: TextStrokeGradient
void TextStrokeGradient(Painter& sw)
{
const char *txt = "GRADIENT TEXT";
Font fnt = Arial(100).Bold();
Size tsz = GetTextSize(txt, fnt);
sw.Text(100, 100, txt, fnt)
.Stroke(4, 100, 100, Blue(), 100 + tsz.cx, 100, LtRed());
}
示例3: OnTextPath
void OnTextPath(Painter& sw)
{
sw.Text(50, 50, "Hello!", Roman(350)).Stroke(1, Black());
for(int i = 0; i <= 100; i++) {
sw.BeginOnPath(i / 100.0);
sw.Move(0, -6).Line(6, 0).Line(0, 6).Fill(Red());
sw.End();
}
}
示例4: Stroke
void Stroke(Painter& sw)
{
const char *txt = "GRM";
Font fnt = Arial(100).Bold();
Size tsz = GetTextSize(txt, fnt);
sw.Scale(3, 3);
sw.Text(100, 100, txt, fnt)
.Stroke(10, 100, 100, Blue(), 100 + tsz.cx, 100, LtRed())
.Stroke(0.25, White());
sw.Path("M 100 100 L 200 100 L 210 90 L 220 40 L 230 90 L 240 100 L 400 100")
.Stroke(24, Blue());
}
示例5: BigStroke
void BigStroke(Painter& sw)
{
int n = 0;
double r = 400;
int i = 0;
while(r > 5) {
Pointf p = Polar(i * M_2PI / 400) * r + Pointf(400, 400);
if(i)
sw.Line(p);
else
sw.Move(p);
sw.Line(Polar((i * M_2PI / 400 + M_2PI / 800)) * (r - 3) + Pointf(400, 400));
n += 2;
r = r - 0.01;
i++;
}
sw.Stroke(1, Black());
sw.Text(0, 0, "Elements: " + AsString(n), Arial(20)).Fill(Blue());
}
示例6: Big
void Big(Painter& sw)
{
int n = 0;
double sgn = 1;
for(int r = 400; r > 5; r -= 3) {
for(int i = 0; i < 400; i++) {
Pointf p = Polar(sgn * i * M_2PI / 400) * r + Pointf(400, 400);
if(i)
sw.Line(p);
else
sw.Move(p);
sw.Line(Polar(sgn * (i * M_2PI / 400 + M_2PI / 800)) * (r - 6) + Pointf(400, 400));
n += 2;
}
sw.Close();
sgn = -sgn;
}
sw.Fill(Black());
sw.Text(0, 0, "Elements: " + AsString(n), Arial(20)).Fill(Blue());
}