本文整理匯總了C#中gbrainy.Core.Main.CairoContextEx.DrawTextAlignedRight方法的典型用法代碼示例。如果您正苦於以下問題:C# CairoContextEx.DrawTextAlignedRight方法的具體用法?C# CairoContextEx.DrawTextAlignedRight怎麽用?C# CairoContextEx.DrawTextAlignedRight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gbrainy.Core.Main.CairoContextEx
的用法示例。
在下文中一共展示了CairoContextEx.DrawTextAlignedRight方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
const double aligned_pos = 0.58;
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.2, number_a.ToString ());
gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.3, number_b.ToString ());
gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.4, number_c.ToString ());
gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.5);
gr.LineTo (DrawAreaX + 0.5, DrawAreaY + 0.5);
gr.Stroke ();
gr.DrawTextAlignedRight (aligned_pos, DrawAreaY + 0.55, total.ToString ());
gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.25);
gr.ShowPangoText ((Answer.Draw == true) ? oper1.ToString () : "?");
gr.MoveTo (DrawAreaX + 0.2, DrawAreaY + 0.35);
gr.ShowPangoText ((Answer.Draw == true) ? oper2.ToString () : "?");
}
示例2: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double operand_y = DrawAreaY + 0.2;
const double operand_space = 0.1;
const double aligned_pos = 0.58;
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
for (int i = 0; i < operands.Length - 1; i++)
{
gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[i].ToString ());
gr.MoveTo (DrawAreaX + 0.2, operand_y + 0.03);
switch (operation) {
case Operation.Addition:
gr.ShowPangoText ("+");
break;
case Operation.Subtraction:
gr.ShowPangoText ("-");
break;
case Operation.Multiplication:
gr.ShowPangoText ("*");
break;
}
operand_y += operand_space;
}
gr.DrawTextAlignedRight (aligned_pos, operand_y, operands[operands.Length - 1].ToString ());
operand_y += 0.08;
gr.MoveTo (DrawAreaX + 0.2, operand_y);
gr.LineTo (DrawAreaX + 0.5, operand_y);
gr.Stroke ();
if (Answer.Draw) {
gr.DrawTextAlignedRight (aligned_pos, operand_y + 0.03, Answer.Correct);
}
}
示例3: DrawColumnBarGraphic
void DrawColumnBarGraphic(CairoContextEx gr, double x, double y)
{
const double area_w = 0.85, area_h = 0.28;
const double bar_w = 0.05, bar_h = area_h - 0.02;
const double space_x = 0.08;
gr.LineWidth = 0.005;
// Draw X reference values
gr.SetPangoFontSize (smaller_font);
gr.DrawTextAlignedRight (x + 0.05, y, "100");
gr.DrawTextAlignedRight (x + 0.05, y + area_h - 0.02, "0");
x += 0.06;
// Axis
gr.MoveTo (x, y);
gr.LineTo (x, y + area_h);
gr.LineTo (x + area_w, y + area_h);
gr.Stroke ();
x = x + space_x;
DrawBar (gr, x, y + area_h, bar_w, bar_h, session.History.TotalScore);
gr.DrawTextCentered (x + bar_w / 2, y + area_h + 0.03, Translations.GetString ("Total"));
x = x + space_x * 2;
if (session.History.LogicPlayed > 0)
DrawBar (gr, x, y + area_h, bar_w, bar_h, session.History.LogicScore);
gr.DrawTextCentered (x + bar_w / 2, y + area_h + 0.03, Translations.GetString ("Logic"));
x = x + space_x * 2;
if (session.History.MathPlayed > 0)
DrawBar (gr, x, y + area_h, bar_w, bar_h, session.History.MathScore);
gr.DrawTextCentered (x + bar_w / 2, y + area_h + 0.03, Translations.GetString ("Calculation"));
x = x + space_x * 2;
if (session.History.MemoryPlayed > 0)
DrawBar (gr, x, y + area_h, bar_w, bar_h, session.History.MemoryScore);
gr.DrawTextCentered (x + bar_w / 2, y + area_h + 0.03, Translations.GetString ("Memory"));
x = x + space_x * 2;
if (session.History.VerbalPlayed > 0)
DrawBar (gr, x, y + area_h, bar_w, bar_h, session.History.VerbalScore);
gr.DrawTextCentered (x + bar_w / 2, y + area_h + 0.03, Translations.GetString ("Verbal"));
}
示例4: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
const double fraction_size = 0.17;
double x = 0.5 - (fractions_num * fraction_size / 2), y = DrawAreaY + 0.3;
const double offset_x = 0.12;
base.Draw (gr, area_width, area_height, rtl);
gr.SetPangoLargeFontSize ();
for (int i = 0; i < fractions_num; i++)
{
// Numerator
gr.DrawTextAlignedRight (x + offset_x, y, fractions[i].Numerator.ToString ());
// Sign
gr.MoveTo (x, y + 0.04);
switch (fractions[i].Operation) {
case Operation.Addition:
gr.ShowPangoText ("+");
break;
case Operation.Subtraction:
gr.ShowPangoText ("-");
break;
}
gr.Stroke ();
// Line
gr.MoveTo (x + 0.05, y + 0.08);
gr.LineTo (x + offset_x + 0.02, y + 0.08);
gr.Stroke ();
// Denominator
gr.DrawTextAlignedRight (x + offset_x, y + 0.1, fractions[i].Denominator.ToString ());
x += fraction_size;
}
}
示例5: DrawGrid
void DrawGrid(CairoContextEx cr, double x, double y)
{
// Draw Axis
cr.MoveTo (x, y);
cr.LineTo (x, y + grid_height);
cr.LineTo (x + grid_width, y + grid_height);
cr.Stroke ();
cr.Save ();
cr.Color = axis_color;
cr.LineWidth = 0.001;
for (double line_y = y; line_y < grid_height + y; line_y += grid_height / 10) {
cr.MoveTo (x, line_y);
cr.LineTo (x + grid_width, line_y);
cr.Stroke ();
}
cr.Restore ();
// Draw score scale
int pos = 100;
for (double line_y = y; line_y < grid_height + y; line_y += grid_height / 10) {
cr.DrawTextAlignedRight (x- 0.01, line_y, String.Format ("{0}", pos));
pos -= 10;
}
}