本文整理汇总了C#中Cairo.FillPreserve方法的典型用法代码示例。如果您正苦于以下问题:C# Cairo.FillPreserve方法的具体用法?C# Cairo.FillPreserve怎么用?C# Cairo.FillPreserve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo
的用法示例。
在下文中一共展示了Cairo.FillPreserve方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawFrame
protected override void DrawFrame (Cairo.Context context, double lineWidth, Cairo.Color lineColor, Cairo.Color fillColor)
{
// base.DrawFrame (context, lineWidth, lineColor, fillColor);
rect = DisplayBox;
rect.OffsetDot5();
// HERZUM SPRINT 1.2
// CairoFigures.CurvedRectangle(context, rect, 30);
CairoFigures.AngleFrame(context, rect, 0,0,0,0);
// END HERZUM SPRINT 1.2
Cairo.Color fillColorOrigin;
fillColorOrigin = fillColor;
lineWidth = 1;
fillColor = new Cairo.Color (1.0, 1.0, 1.0, 1.0);
context.Color = fillColor;
context.FillPreserve();
context.Color = lineColor;
context.LineWidth = lineWidth;
double[] dash = {2, 0, 2};
context.SetDash (dash, 0);
context.Stroke();
rect2 = DisplayBox;
rect2.Width = DisplayBox.Width;
rect2.Height = 30;
rect2.OffsetDot5();
CairoFigures.CurvedRectangle(context, rect2, 30);
fillColor = fillColorOrigin;
context.Color = fillColor;
context.FillPreserve();
context.Color = lineColor;
context.LineWidth = lineWidth;
context.Stroke();
// HERZUM SPRINT 2.1
// m_applicationContext.MainWindow.ExperimentCanvasPad.LoopNodeControlCurrent = this;
// END HERZUM SPRINT 2.1
// HERZUM SPRINT 5.0: TLAB-235
// DrawScope ();
DrawScope ("Enter","Exit");
// END HERZUM SPRINT 5.0: TLAB-235
}
示例2: DrawIcon
static void DrawIcon (MonoTextEditor editor, Cairo.Context cr, DocumentLine lineSegment, double x, double y, double width, double height)
{
if (lineSegment.IsBookmarked) {
var color1 = editor.ColorStyle.Bookmarks.Color;
var color2 = editor.ColorStyle.Bookmarks.SecondColor;
DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);
// FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
pat.AddColorStop (0, color1);
pat.AddColorStop (1, color2);
cr.SetSource (pat);
cr.FillPreserve ();
}
// FIXME: VV: Remove gradient features
using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
pat.AddColorStop (0, color2);
//pat.AddColorStop (1, color1);
cr.SetSource (pat);
cr.Stroke ();
}
}
}
示例3: draw
static void draw (Cairo.Context gr, int width, int height)
{
gr.Scale (width, height);
gr.LineWidth = 0.04;
gr.MoveTo ( new PointD (0.5, 0.1) );
gr.LineTo ( new PointD (0.9, 0.9) );
gr.RelLineTo ( new Distance (-0.4, 0.0) );
gr.CurveTo ( new PointD (0.2, 0.9),
new PointD ( 0.2, 0.5),
new PointD (0.5, 0.5)
);
gr.ClosePath ();
gr.MoveTo ( new PointD (0.25, 0.1) );
gr.RelLineTo ( new Distance (0.2, 0.2) );
gr.RelLineTo ( new Distance ( -0.2, 0.2) );
gr.RelLineTo ( new Distance (-0.2, -0.2) );
gr.ClosePath ();
gr.Color = new Color (0, 0, 1, 1);
gr.FillPreserve ();
gr.Color = new Color ( 0, 0, 0, 1);
gr.Stroke ();
}
示例4: DrawFace
void DrawFace (Cairo.PointD center, double radius, Cairo.Context e)
{
e.Arc (center.X, center.Y, radius, 0, 360);
Cairo.Gradient pat = new Cairo.LinearGradient (100, 200, 200, 100);
pat.AddColorStop (0, Generator.ConvertC (new Eto.Drawing.Color (240, 240, 230, 75)));
pat.AddColorStop (1, Generator.ConvertC (new Eto.Drawing.Color (0, 0, 0, 50)));
e.LineWidth = 0.1;
e.Pattern = pat;
e.FillPreserve ();
e.Stroke ();
}
示例5: DrawFrame
protected override void DrawFrame (Cairo.Context context, double lineWidth, Cairo.Color lineColor, Cairo.Color fillColor)
{
RectangleD rect = DisplayBox;
rect.OffsetDot5();
CairoFigures.AngleFrame(context, rect, 15, 0, 15, 0);
context.Color = fillColor;
context.FillPreserve();
context.Color = lineColor;
context.LineWidth = lineWidth;
context.Stroke();
}
示例6: DrawFrame
protected override void DrawFrame (Cairo.Context context, double lineWidth, Cairo.Color lineColor, Cairo.Color fillColor)
{
RectangleD rect = DisplayBox;
rect.OffsetDot5();
context.Rectangle(GdkCairoHelper.CairoRectangle(rect));
context.Color = fillColor;
context.FillPreserve();
context.Color = lineColor;
context.LineWidth = lineWidth;
context.Stroke();
}
示例7: DrawFace
static void DrawFace (Cairo.PointD center, double radius, Cairo.Context e)
{
e.Arc (center.X, center.Y, radius, 0, 360);
Cairo.Gradient pat = new Cairo.LinearGradient (100, 200, 200, 100);
pat.AddColorStop (0, Eto.Drawing.Color.FromArgb (240, 240, 230, 75).ToCairo ());
pat.AddColorStop (1, Eto.Drawing.Color.FromArgb (0, 0, 0, 50).ToCairo ());
e.LineWidth = 0.1;
e.Pattern = pat;
e.FillPreserve ();
e.Stroke ();
}
示例8: DrawIcon
public void DrawIcon (TextEditor editor, Cairo.Context cr, LineSegment lineSegment, int lineNumber, double x, double y, double width, double height)
{
if (lineSegment.IsBookmarked) {
Cairo.Color color1 = editor.ColorStyle.BookmarkColor1;
Cairo.Color color2 = editor.ColorStyle.BookmarkColor2;
DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);
Cairo.Gradient pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4);
pat.AddColorStop (0, color1);
pat.AddColorStop (1, color2);
cr.Pattern = pat;
cr.FillPreserve ();
pat = new Cairo.LinearGradient (x, y + height, x + width, y);
pat.AddColorStop (0, color2);
//pat.AddColorStop (1, color1);
cr.Pattern = pat;
cr.Stroke ();
}
}
示例9: draw
static void draw (Cairo.Context gr, int width, int height)
{
gr.Scale (width, height);
gr.LineWidth = 0.04;
gr.SelectFontFace ("Sans", FontSlant.Normal, FontWeight.Bold);
gr.SetFontSize (0.35);
gr.MoveTo ( new PointD(0.04, 0.53) );
gr.ShowText ("Hello");
gr.MoveTo ( new PointD(0.27, 0.65) );
gr.TextPath ("void");
gr.ColorRgb = new Color (0.5, 0.5, 1, 0);
gr.FillPreserve ();
gr.ColorRgb = new Color (0, 0, 0, 0);
gr.LineWidth = 0.01;
gr.Stroke ();
gr.Color = new Color (1,0.2,0.2, 0.6);
gr.Arc (0.04, 0.53, 0.02, 0, 2*M_PI);
gr.Arc (0.27, 0.65, 0.02, 0, 2*M_PI);
gr.Fill ();
}
示例10: DrawSearchIndicator
protected void DrawSearchIndicator (Cairo.Context cr)
{
int diameter = Math.Min (Allocation.Width, (int)IndicatorHeight) - indicatorPadding * 2;
var x1 = Math.Round (Allocation.Width / 2d);
double y1 = indicatorPadding;
if (diameter % 2 == 0) {
x1 += 0.5;
y1 += 0.5;
}
cr.Arc (x1, y1, diameter / 2d, 0, 2 * Math.PI);
var darkColor = (HslColor)TextEditor.ColorStyle.SearchResult.Color;
darkColor.L *= 0.5;
if (flatStyle) {
using (var pattern = new Cairo.SolidPattern (TextEditor.ColorStyle.SearchResultMain.Color)) {
cr.Pattern = pattern;
cr.FillPreserve ();
}
} else {
using (var pattern = new Cairo.RadialGradient (x1, y1, Allocation.Width / 2, x1 - Allocation.Width, y1 - Allocation.Width, Allocation.Width)) {
pattern.AddColorStop (0, darkColor);
pattern.AddColorStop (1, TextEditor.ColorStyle.SearchResultMain.Color);
cr.Pattern = pattern;
cr.FillPreserve ();
}
}
cr.Color = darkColor;
cr.Stroke ();
}
示例11: DrawIcon
public void DrawIcon(TextEditor editor, Cairo.Context cr, DocumentLine lineSegment, int lineNumber, double x, double y, double width, double height)
{
if (BookmarkService.Instance.CheckLineForBookmark (editor.FileName, lineSegment.LineNumber)) {
Cairo.Color color1 = editor.ColorStyle.Bookmarks.Color;
Cairo.Color color2 = editor.ColorStyle.Bookmarks.SecondColor;
if (Bookmark.BookmarkType == BookmarkType.Local)
DrawRoundRectangle (cr, x + 1, y + 1, 8, width - 4, height - 4);
else
DrawCircle (cr, x + (width / 2), y + (height / 2), 6);
using (var pat = new Cairo.LinearGradient (x + width / 4, y, x + width / 2, y + height - 4)) {
pat.AddColorStop (0, color1);
pat.AddColorStop (1, color2);
cr.Pattern = pat;
cr.FillPreserve ();
}
using (var pat = new Cairo.LinearGradient (x, y + height, x + width, y)) {
pat.AddColorStop (0, color2);
//pat.AddColorStop (1, color1);
cr.Pattern = pat;
cr.Stroke ();
}
cr.Color = new Cairo.Color (0, 0, 0);
cr.SelectFontFace (DesktopService.DefaultMonospaceFont, Cairo.FontSlant.Normal, Cairo.FontWeight.Bold);
cr.SetFontSize (12);
var te = cr.TextExtents (Bookmark.Number.ToString ());
cr.MoveTo (x + 5, y + 1 + te.Height);
cr.ShowText (Bookmark.Number.ToString ());
}
}
示例12: DrawProgressBar
void DrawProgressBar (Cairo.Context context, double progress, Gdk.Rectangle bounding, StatusArea.RenderArg arg)
{
LayoutRoundedRectangle (context, new Gdk.Rectangle (bounding.X, bounding.Y, (int) (bounding.Width * progress), bounding.Height));
context.Clip ();
LayoutRoundedRectangle (context, bounding);
context.Color = Styles.WithAlpha (Styles.StatusBarProgressBackgroundColor, Styles.StatusBarProgressBackgroundColor.A * arg.ProgressBarAlpha);
context.FillPreserve ();
context.ResetClip ();
context.Color = Styles.WithAlpha (Styles.StatusBarProgressOutlineColor, Styles.StatusBarProgressOutlineColor.A * arg.ProgressBarAlpha);
context.LineWidth = 1;
context.Stroke ();
}
示例13: DrawBackground
void DrawBackground(Cairo.Context context, Gdk.Rectangle region, int radius, StateType state)
{
double rad = radius - 0.5;
int centerX = region.X + region.Width / 2;
int centerY = region.Y + region.Height / 2;
context.MoveTo (centerX + rad, centerY);
context.Arc (centerX, centerY, rad, 0, Math.PI * 2);
double high;
double low;
switch (state) {
case StateType.Selected:
high = 0.85;
low = 1.0;
break;
case StateType.Prelight:
high = 1.0;
low = 0.9;
break;
case StateType.Insensitive:
high = 0.95;
low = 0.83;
break;
default:
high = 1.0;
low = 0.85;
break;
}
using (var lg = new LinearGradient (0, centerY - rad, 0, centerY +rad)) {
lg.AddColorStop (0, new Cairo.Color (high, high, high));
lg.AddColorStop (1, new Cairo.Color (low, low, low));
context.SetSource (lg);
context.FillPreserve ();
}
context.SetSourceRGBA (0, 0, 0, 0.4);
context.LineWidth = 1;
context.Stroke ();
}
示例14: DrawExpander
void DrawExpander (Cairo.Context ctx, double ex, double ey, bool expanded, bool hilight)
{
ctx.NewPath ();
ctx.LineWidth = 1;
ctx.Rectangle (ex, ey, ExpanderSize, ExpanderSize);
if (hilight)
ctx.SetSourceColor (Style.Background (Gtk.StateType.Normal).ToCairoColor ());
else
ctx.SetSourceColor (Style.White.ToCairoColor ());
ctx.FillPreserve ();
ctx.SetSourceColor (Style.Foreground (Gtk.StateType.Normal).ToCairoColor ());
ctx.Stroke ();
ctx.NewPath ();
ctx.MoveTo (ex + 2, ey + (ExpanderSize/2));
ctx.RelLineTo (ExpanderSize - 4, 0);
if (!expanded) {
ctx.MoveTo (ex + (ExpanderSize/2), ey + 2);
ctx.RelLineTo (0, ExpanderSize - 4);
}
ctx.Stroke ();
}
示例15: DrawCodeSegmentBorder
void DrawCodeSegmentBorder (Gdk.GC gc, Cairo.Context ctx, double x, int width, BlockInfo firstBlock, BlockInfo lastBlock, string[] lines, Gtk.Widget widget, Gdk.Drawable window)
{
int shadowSize = 2;
int spacing = 4;
int bottomSpacing = (lineHeight - spacing) / 2;
ctx.Rectangle (x + shadowSize + 0.5, firstBlock.YStart + bottomSpacing + spacing - shadowSize + 0.5, width - shadowSize*2, shadowSize);
ctx.Color = new Cairo.Color (0.9, 0.9, 0.9);
ctx.LineWidth = 1;
ctx.Fill ();
ctx.Rectangle (x + shadowSize + 0.5, lastBlock.YEnd + bottomSpacing + 0.5, width - shadowSize*2, shadowSize);
ctx.Color = new Cairo.Color (0.9, 0.9, 0.9);
ctx.Fill ();
ctx.Rectangle (x + 0.5, firstBlock.YStart + bottomSpacing + spacing + 0.5, width, lastBlock.YEnd - firstBlock.YStart - spacing);
ctx.Color = new Cairo.Color (0.7,0.7,0.7);
ctx.Stroke ();
string text = lines[firstBlock.FirstLine].Replace ("@","").Replace ("-","");
text = "<span size='x-small'>" + text.Replace ("+","</span><span size='small'>➜</span><span size='x-small'> ") + "</span>";
layout.SetText ("");
layout.SetMarkup (text);
int tw,th;
layout.GetPixelSize (out tw, out th);
th--;
int dy = (lineHeight - th) / 2;
ctx.Rectangle (x + 2 + LeftPaddingBlock - 1 + 0.5, firstBlock.YStart + dy - 1 + 0.5, tw + 2, th + 2);
ctx.LineWidth = 1;
ctx.Color = widget.Style.Base (Gtk.StateType.Normal).ToCairoColor ();
ctx.FillPreserve ();
ctx.Color = new Cairo.Color (0.7, 0.7, 0.7);
ctx.Stroke ();
window.DrawLayout (gc, (int)(x + 2 + LeftPaddingBlock), firstBlock.YStart + dy, layout);
}