本文整理汇总了C#中Cairo.Context.InFill方法的典型用法代码示例。如果您正苦于以下问题:C# Context.InFill方法的具体用法?C# Context.InFill怎么用?C# Context.InFill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo.Context
的用法示例。
在下文中一共展示了Context.InFill方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckTextExtents
/** FAST */
public static bool CheckTextExtents(Context cr, TextExtents te, double x, double y)
{
bool retval = false;
cr.Save ();
PointD pt = cr.CurrentPoint;
cr.NewPath ();
cr.Rectangle (pt.X, pt.Y, te.Width, te.Height);
cr.IdentityMatrix ();
retval = cr.InFill (x, y);
if (ShowTextExtents) {
cr.Operator = Operator.Over;
cr.Color = new Color (1,0.5,1,0.5);
cr.LineWidth = 0.5;
cr.Stroke ();
}
cr.Restore ();
cr.MoveTo (pt.X, pt.Y);
return retval;
}
示例2: ClickBreadcrumb
/** FAST */
bool ClickBreadcrumb(Context cr, uint width, double x, double y)
{
if (CurrentDirPath == Helpers.RootDir) return false;
TextExtents te1 = Helpers.GetTextExtents (cr, BreadcrumbFontFamily, BreadcrumbFontSize, String.Join(dirSep, CurrentDirPath.Split(Helpers.DirSepC)) + dirSep);
cr.Save ();
double areaWidth = width-BreadcrumbMarginLeft-BreadcrumbMarginRight;
cr.Rectangle (0,0,areaWidth, te1.Height);
cr.Clip ();
cr.Translate (Math.Min(0,areaWidth-te1.Width), -BreadcrumbMarginTop);
if (areaWidth - te1.Width >= 0)
cr.Translate(-(BreadcrumbMarginLeft+1), 0);
cr.MoveTo (0.0, 0.0);
int hitIndex = 0;
string[] segments = CurrentDirPath.Split(Helpers.DirSepC);
foreach (string s in segments) {
string name = (s == "") ? rootChar : s+dirSep;
TextExtents te = Helpers.GetTextExtents (cr, BreadcrumbFontFamily, BreadcrumbFontSize, name);
te.Height += BreadcrumbMarginTop;
if (s == "" && (areaWidth - te1.Width >= 0))
te.Width += BreadcrumbMarginLeft+1;
if (Helpers.CheckTextExtents(cr, te, x, y)) {
string newDir = String.Join(Helpers.DirSepS, segments, 0, hitIndex+1);
if (newDir == "") newDir = Helpers.RootDir;
if (newDir != CurrentDirPath) {
SetCurrentDir (newDir);
} else {
ResetZoom ();
UpdateLayout ();
}
cr.Restore ();
return true;
}
cr.RelMoveTo( te.Width, 0 );
hitIndex += 1;
}
cr.IdentityMatrix ();
cr.Rectangle (0,-1,width,2);
if (cr.InFill(x,y)) {
ResetZoom ();
UpdateLayout ();
}
cr.Restore ();
return false;
}