本文整理汇总了C#中Cairo.RelMoveTo方法的典型用法代码示例。如果您正苦于以下问题:C# Cairo.RelMoveTo方法的具体用法?C# Cairo.RelMoveTo怎么用?C# Cairo.RelMoveTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo
的用法示例。
在下文中一共展示了Cairo.RelMoveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawOutputndicator
private void DrawOutputndicator(Cairo.Context context)
{
context.Save();
RelativeLocator locator = new RelativeLocator(-0.04, 1.2);
PointD point = locator.Locate(this);
context.MoveTo(point);
context.LineCap = LineCap.Round;
context.Color = s_ioIndicatorColor;
double l = 4; //arm lenght of indicator icon
double s = 0.4; //spacing between arms in the indicator icon
//draw <<
//up
context.RelLineTo (new Distance (-s, -l));
context.RelMoveTo (new Distance (s, l)); //back
//right
context.RelLineTo (new Distance (l, s));
context.RelMoveTo (new Distance (-l, -s)); //back
context.RelMoveTo (new Distance (3, -3));
//repeat above for second arrow
context.RelLineTo (new Distance (-s, -l));
context.RelMoveTo (new Distance (s, l)); //back
context.RelLineTo (new Distance (l, s));
context.RelMoveTo (new Distance (-l, -s)); //back
context.Stroke();
context.Restore();
}
示例2: DrawLineEndAtIter
static void DrawLineEndAtIter (Cairo.Context cntx, TextView view, TextIter iter)
{
Gdk.Rectangle rect = view.GetIterLocation (iter);
int x, y;
view.BufferToWindowCoords (TextWindowType.Text,
rect.X,
rect.Y + rect.Height / 2,
out x, out y);
cntx.Save ();
cntx.Color = GetDrawingColorForIter (view, iter);
double arrowSize = 3;
cntx.MoveTo (x + 10, y);
cntx.RelLineTo (new Cairo.Distance (0, -arrowSize));
cntx.RelMoveTo (new Cairo.Distance (0, arrowSize));
cntx.RelLineTo (new Cairo.Distance (-8, 0));
cntx.RelLineTo (new Cairo.Distance (arrowSize, arrowSize));
cntx.RelMoveTo (new Cairo.Distance (-arrowSize, -arrowSize));
cntx.RelLineTo (new Cairo.Distance (arrowSize, -arrowSize));
cntx.Stroke ();
cntx.Restore ();
}