本文整理汇总了C#中gbrainy.Core.Main.CairoContextEx.Stroke方法的典型用法代码示例。如果您正苦于以下问题:C# CairoContextEx.Stroke方法的具体用法?C# CairoContextEx.Stroke怎么用?C# CairoContextEx.Stroke使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gbrainy.Core.Main.CairoContextEx
的用法示例。
在下文中一共展示了CairoContextEx.Stroke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.2, y = DrawAreaY + 0.2, width = 0.4, height = 0.4;
base.Draw (gr, area_width, area_height, rtl);
gr.Rectangle (x, y, width, height);
gr.Stroke ();
gr.MoveTo (x, y + 0.1);
gr.LineTo (x + width, y + 0.1); // First horizontal
gr.Stroke ();
gr.MoveTo (x, y + 0.3);
gr.LineTo (x + width - 0.1, y + 0.3); // Second horizontal
gr.Stroke ();
gr.MoveTo (x + 0.1, y);
gr.LineTo (x + 0.1, y + height); // First vertical
gr.Stroke ();
gr.MoveTo (x + 0.3, y);
gr.LineTo (x + 0.3, y + height - 0.1); // Second vertical
gr.Stroke ();
}
示例2: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.1, y = DrawAreaY + 0.2;
const double witdh = 0.6, height = 0.5;
base.Draw (gr, area_width, area_height, rtl);
gr.MoveTo (x, y);
gr.LineTo (x + witdh, y);
gr.LineTo (x + witdh / 2, y + height / 2);
gr.LineTo (x, y);
gr.LineTo (x + 0.45, y + height /4);
gr.Stroke ();
if (type == 0) {
gr.MoveTo (x + witdh / 2, y);
gr.LineTo (x + witdh / 2, y + height / 2);
gr.Stroke ();
}
gr.MoveTo (x + 0.152, y + 0.125);
gr.LineTo (x + witdh, y);
gr.Stroke ();
if (Answer.Draw == false)
return;
// References
gr.MoveTo (x - 0.02, y);
gr.ShowPangoText ("a");
gr.MoveTo (x + witdh /2 - 0.02, y);
gr.ShowPangoText ("b");
gr.MoveTo (x + witdh, y);
gr.ShowPangoText ("c");
gr.MoveTo (x + witdh /2 - 0.03, y + 0.07 - 0.02);
gr.ShowPangoText ("d");
gr.MoveTo (x + 0.11, y + 0.16);
gr.ShowPangoText ("e");
gr.MoveTo (x + 0.47, y + 0.16);
gr.ShowPangoText ("f");
gr.MoveTo (x + (witdh /2) - 0.01, y + 0.26);
gr.ShowPangoText ("g");
}
示例3: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double rect_w = DrawAreaWidth / rows;
double rect_h = DrawAreaHeight / columns;
base.Draw (gr, area_width, area_height, rtl);
for (int column = 0; column < columns; column++) {
for (int row = 0; row < rows; row++) {
gr.Color = DefaultDrawingColor;
gr.Rectangle (DrawAreaX + row * rect_w, DrawAreaY + column * rect_h, rect_w, rect_h);
gr.Stroke ();
gr.DrawTextCentered (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
(numbers[column + (row * 4)]).ToString() );
if (numbers[column + (row * 4)] % divisor == 0 && good_pos != column + (row * 4)) {
gr.Arc (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
0.05, 0, 2 * Math.PI);
gr.FillGradient (DrawAreaX + (rect_w / 2) + column * rect_w, (rect_h / 2) + DrawAreaY + row * rect_h,
0.05, 0.05);
}
gr.Stroke ();
}
}
}
示例4: DrawPossibleAnswers
public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
int cnt = 0;
for (int i = 0; i < showed; i++)
{
if (i == answer)
continue;
gr.MoveTo (x, y);
gr.ShowPangoText (animals[animals_order[i]]);
gr.Stroke ();
if ((cnt + 1) % 3 == 0) {
y += 0.2;
x = DrawAreaX + 0.125;
} else {
x+= 0.25;
}
cnt++;
}
gr.Color = new Color (0.9, 0.9, 0.9);
gr.DrawTextCentered (0.5, DrawAreaY, "This is an extension sample");
}
示例5: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = 0.25, y = 0.25;
base.Draw (gr, area_width, area_height, rtl);
gr.Rectangle (x, y, width, height);
gr.Stroke ();
gr.MoveTo (x, y + height / 2);
gr.LineTo (x + width, y + height / 2);
gr.Stroke ();
gr.MoveTo (x + width / 2, y);
gr.LineTo (x + width / 2, y + height);
gr.Stroke ();
if (cover_zone1)
CoverZone (gr, x, y);
if (cover_zone2)
CoverZone (gr, x + width / 2, y);
if (cover_zone3)
CoverZone (gr, x, y + height / 2);
if (cover_zone4)
CoverZone (gr, x + width / 2, y + height / 2);
switch (partial_zone) {
case 1:
break;
case 2:
x += width / 2;
break;
case 3:
y += height / 2;
break;
case 4:
y += height / 2;
x += width / 2;
break;
}
DrawSection (gr, x, y);
}
示例6: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.1, y = DrawAreaY + 0.05;
base.Draw (gr, area_width, area_height, rtl);
for (int i = 0; i < circles.Length; i++)
{
gr.Arc (x + circles[i].x + 0.1, y + circles[i].y + 0.1, circles[i].rad, 0, 2 * Math.PI);
gr.Stroke ();
}
}
示例7: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = X, y = Y;
this.rtl = rtl;
#if DESIGN_MODE
gr.Save ();
gr.Color = new Cairo.Color (0, 0, 1);
gr.Rectangle (X, Y, Width, Height);
gr.Stroke ();
gr.Restore ();
double width = 0;
foreach (Widget child in children)
{
width += child.Width;
if (Height < child.Height)
throw new InvalidOperationException (String.Format ("Container height too small {0} < {1}", Height, child.Height));
}
if (Width < width)
throw new InvalidOperationException (String.Format ("Container witdh too small {0} < {1}", Width, width));
#endif
//
// Coordinates are stored right to left
//
if (rtl == false) {
for (int i = 0; i < children.Count; i++)
{
gr.Save ();
gr.Translate (x, y);
children[i].Draw (gr, area_width, area_height, rtl);
gr.Restore ();
x += children[i].Width;
}
} else {
x += Width;
for (int i = 0; i < children.Count; i++)
{
x -= children[i].Width;
gr.Save ();
gr.Translate (x, y);
children[i].Draw (gr, area_width, area_height, rtl);
gr.Restore ();
}
}
}
示例8: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double rect_w = DrawAreaWidth / rows;
double rect_h = DrawAreaHeight / columns;
base.Draw (gr, area_width, area_height, rtl);
for (int column = 0; column < columns; column++) {
for (int row = 0; row < rows; row++) {
gr.Rectangle (DrawAreaX + row * rect_w, DrawAreaY + column * rect_h, rect_w, rect_h);
}
}
gr.Stroke ();
}
示例9: DrawObjectToMemorize
public override void DrawObjectToMemorize(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.DrawObjectToMemorize (gr, area_width, area_height, rtl);
if (Answer.Draw == false) {
for (int i = 0; i < indications.Length; i++)
{
gr.MoveTo (0.3, 0.2 + i * 0.08);
gr.ShowPangoText (indications[i].ToString ());
gr.Stroke ();
}
} else {
for (int i = 0; i < indications.Length; i++)
{
gr.MoveTo (0.1, 0.2 + i * 0.08);
gr.ShowPangoText (indications[i].ToString ());
gr.Stroke ();
}
DrawPossibleAnswers (gr, 0.7, 0.3, WhichAnswer (answers[ans]));
gr.MoveTo (0.7, 0.5);
gr.ShowPangoText (Answer.GetFigureName (ans));
gr.Stroke ();
}
}
示例10: Draw
public void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
gr.Scale (area_width, area_height);
gr.LineWidth = 0.01;
gr.Color = new Cairo.Color (0, 0, 0, 1);
gr.SetPangoLargeFontSize ();
gr.DrawTextCentered (0.5, 0.1, ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Get ready to memorize the next objects..."));
gr.Stroke ();
gr.SetPangoFontSize (0.35);
gr.DrawTextCentered (0.5, 0.5, countdown_time.ToString ());
gr.Stroke ();
gr.Arc (0.5, 0.5, 0.25, 0, 2 * Math.PI);
gr.Stroke ();
gr.Arc (0.5, 0.5, 0.28, 0, 2 * Math.PI);
gr.Stroke ();
}
示例11: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = X, y = Y;
this.rtl = rtl;
#if DESIGN_MODE
gr.Save ();
gr.Color = new Cairo.Color (0, 0, 1);
gr.Rectangle (X, Y, Width, Height);
gr.Stroke ();
gr.Restore ();
ValidateDimensions ();
#endif
//
// Coordinates are stored right to left
//
if (rtl == false) {
for (int i = 0; i < children.Count; i++)
{
gr.Save ();
gr.Translate (x, y);
children[i].Draw (gr, area_width, area_height, rtl);
gr.Restore ();
x += children[i].Width;
}
} else {
x += Width;
for (int i = 0; i < children.Count; i++)
{
x -= children[i].Width;
gr.Save ();
gr.Translate (x, y);
children[i].Draw (gr, area_width, area_height, rtl);
gr.Restore ();
}
}
}
示例12: DrawPossibleAnswers
public override void DrawPossibleAnswers(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x= DrawAreaX + 0.125, y = DrawAreaY + 0.1;
int cnt = 0;
for (int i = 0; i < showed; i++)
{
if (i == answer)
continue;
gr.MoveTo (x, y);
gr.ShowPangoText (words[words_order[i]]);
gr.Stroke ();
if ((cnt + 1) % 3 == 0) {
y += 0.2;
x = DrawAreaX + 0.125;
} else {
x+= 0.25;
}
cnt++;
}
}
示例13: 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 () : "?");
}
示例14: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX + 0.22, y = DrawAreaY + 0.2;
double pos_x = x;
double pos_y = y;
Circle[] circles = null;
base.Draw (gr, area_width, area_height, rtl);
circles = new Circle [] {
new Circle (0.01, 0.06),
new Circle (0.27, 0.06),
new Circle (0.01, 0.21),
new Circle (0.27, 0.21),
new Circle (0.14, 0),
new Circle (0.14, 0.29)
};
// Circle
gr.Arc (pos_x + figure_size, pos_y + figure_size, figure_size, 0, 2 * Math.PI);
gr.Stroke ();
const double point_size = 0.01;
for (int i = 0; i < circles.Length; i++) {
gr.Arc (x + point_size + circles[i].x, y + point_size + circles[i].y, point_size, 0, 2 * Math.PI);
gr.Fill ();
gr.Stroke ();
}
gr.MoveTo (x + circles[2].x + 0.01, y + circles[2].y + 0.01);
gr.LineTo (x + circles[1].x + 0.01, y + circles[1].y + 0.01);
gr.Stroke ();
gr.DrawTextCentered (pos_x + figure_size, pos_y + 0.08 + figure_size * 2,
ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Two people in the table sitting across each other"));
}
示例15: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double x = DrawAreaX, y = 0.05;
base.Draw (gr, area_width, area_height, rtl);
gr.MoveTo (0.05, y);
gr.SetPangoLargeFontSize ();
gr.ShowPangoText (Translations.GetString ("Numbers"));
y += 0.08;
for (int n = 0; n < numbers.Length; n++)
{
gr.MoveTo (x, y);
gr.ShowPangoText (numbers[n].ToString ());
gr.Stroke ();
x += 0.17;
}
y += 0.16;
gr.MoveTo (0.05, y);
gr.ShowPangoText (Translations.GetString ("Possible divisors"));
}