本文整理汇总了C#中gbrainy.Core.Main.CairoContextEx.DrawImageFromAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# CairoContextEx.DrawImageFromAssembly方法的具体用法?C# CairoContextEx.DrawImageFromAssembly怎么用?C# CairoContextEx.DrawImageFromAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gbrainy.Core.Main.CairoContextEx
的用法示例。
在下文中一共展示了CairoContextEx.DrawImageFromAssembly方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
if (problems[problem].single)
gr.DrawImageFromAssembly ("dice.svg", 0.3, 0.3, 0.4, 0.4);
else {
gr.DrawImageFromAssembly ("dice.svg", 0.1, 0.3, 0.4, 0.4);
gr.DrawImageFromAssembly ("dice.svg", 0.5, 0.3, 0.4, 0.4);
}
}
示例2: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
if (gametype == GameType.Present) {
gr.DrawImageFromAssembly ("present.svg", 0.2, 0.4, 0.6, 0.2);
} else {
if (gametype == GameType.Fence)
{
double x105, y105, y;
const double x = 0.35;
const double figure_size = 0.4;
x105 = figure_size * Math.Cos (105 * Math.PI / 180);
y105 = figure_size * Math.Sin (105 * Math.PI / 180);
y = (1 - y105) / 2;
gr.MoveTo (x, y);
gr.LineTo (x + x105, y + y105);
gr.LineTo (x + x105 + figure_size, y + y105);
gr.Stroke ();
gr.MoveTo (x + figure_size, y);
gr.LineTo (x + figure_size + x105, y + y105);
gr.Stroke ();
gr.MoveTo (x, y);
gr.LineTo (x + figure_size, y);
gr.Stroke ();
}
}
}
示例3: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
if (String.IsNullOrEmpty (svg_image) == false)
gr.DrawImageFromAssembly (svg_image, 0.25, 0.25, 0.5, 0.5);
}
示例4: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
gr.DrawImageFromAssembly ("people_table.svg", 0.2, 0.2, 0.6, 0.6);
gr.DrawTextCentered (0.5, 0.85,
Translations.GetString ("Two people in the table sitting across each other"));
}
示例5: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
string train_right = "train_right.svg";
string train_left = "train_left.svg";
base.Draw (gr, area_width, area_height, rtl);
switch (gametype)
{
case GameType.Overtake:
gr.DrawImageFromAssembly (train_right, 0, 0.1, 0.5, 0.55);
gr.MoveTo (0.1, 0.45);
gr.LineTo (0.9, 0.45);
gr.Stroke ();
gr.DrawImageFromAssembly (train_right, 0.5, 0.1, 0.5, 0.55);
break;
case GameType.Meet:
gr.DrawImageFromAssembly (train_right, 0, 0.1, 0.5, 0.55);
gr.MoveTo (0.1, 0.45);
gr.LineTo (0.9, 0.45);
gr.Stroke ();
gr.DrawImageFromAssembly (train_left, 0.55, 0.3, 0.5, 0.55);
gr.MoveTo (0.1, 0.65);
gr.LineTo (0.9, 0.65);
gr.Stroke ();
break;
case GameType.Apart:
gr.DrawImageFromAssembly (train_right, 0.35, 0.1, 0.5, 0.55);
gr.MoveTo (0.1, 0.45);
gr.LineTo (0.9, 0.45);
gr.Stroke ();
gr.DrawImageFromAssembly (train_left, 0.15, 0.3, 0.5, 0.55);
gr.MoveTo (0.1, 0.65);
gr.LineTo (0.9, 0.65);
gr.Stroke ();
break;
default:
throw new Exception ("Unexpected value");
}
}
示例6: Draw
public override void Draw(CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
gr.DrawImageFromAssembly ("handshake.svg", 0.2, 0.6, 0.6, 0.3);
}
示例7: DrawBalance
public void DrawBalance(CairoContextEx gr, double x, double y, int index, bool full)
{
const double width = 0.5;
double fig_x = x + 0.1, fig_y = y - 0.08;
int total = (full == true) ? (elements * 2) : elements;
for (int i = 0; i < total; i++) {
switch (balances[i + index]) {
case 1:
gr.DrawEquilateralTriangle (fig_x, fig_y, 0.05);
break;
case 2:
gr.Arc (fig_x + (0.05 / 2), fig_y + (0.05 / 2) + 0.003, (0.05 / 2), 0, 2 * Math.PI);
gr.Stroke ();
break;
case 3:
gr.Rectangle (fig_x, fig_y + 0.005, 0.045, 0.045);
gr.Stroke ();
break;
}
if (i == elements - 1)
fig_x = x + 0.54;
else
fig_x += 0.07;
}
gr.DrawImageFromAssembly ("balance.svg", x + 0.02, y - 0.08, 0.9, 0.25);
}
示例8: DrawFigure
private void DrawFigure(CairoContextEx gr, double x, double y, Face fig)
{
double space_x, space_y;
string image;
space_x = (rect_w - figure_size) / 2;
space_y = (rect_h - figure_size) / 2;
switch (fig) {
case Face.FaceBoy1:
image = "faceboy1.svg";
break;
case Face.FaceBoy2:
image = "faceboy2.svg";
break;
case Face.FaceBoy3:
image = "faceboy3.svg";
break;
case Face.FaceGirl1:
image = "facegirl1.svg";
break;
case Face.FaceGirl2:
image = "facegirl2.svg";
break;
case Face.FaceGirl3:
image = "facegirl3.svg";
break;
default:
throw new InvalidOperationException("Invalid value");
}
gr.DrawImageFromAssembly (image, x + space_x, y + space_y, figure_size, figure_size);
}