本文整理汇总了C#中Cairo.Context.FillRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Context.FillRectangle方法的具体用法?C# Context.FillRectangle怎么用?C# Context.FillRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cairo.Context
的用法示例。
在下文中一共展示了Context.FillRectangle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawShape
protected override Rectangle DrawShape(Rectangle rect, Layer l)
{
Rectangle dirty;
using (Context g = new Context (l.Surface)) {
g.AppendPath (PintaCore.Layers.SelectionPath);
g.FillRule = FillRule.EvenOdd;
g.Clip ();
g.Antialias = Antialias.Subpixel;
if (FillShape && StrokeShape)
dirty = g.FillStrokedRectangle (rect, fill_color, outline_color, BrushWidth);
else if (FillShape)
dirty = g.FillRectangle (rect, outline_color);
else
dirty = g.DrawRectangle (rect, outline_color, BrushWidth);
}
return dirty;
}
示例2: CellRendererSurface
public CellRendererSurface(int width, int height)
{
// TODO: Respect cell padding (Xpad and Ypad).
SetFixedSize (width, height);
transparent = new Cairo.ImageSurface (Cairo.Format.ARGB32, width, height);
Cairo.Color gray = new Cairo.Color (.75, .75, .75);
// Create checkerboard background
int grid_width = 4;
using (Cairo.Context g = new Cairo.Context (transparent)) {
g.Color = new Cairo.Color (1, 1, 1);
g.Paint ();
for (int y = 0; y < height; y += grid_width)
for (int x = 0; x < width; x += grid_width)
if ((x / grid_width % 2) + (y / grid_width % 2) == 1)
g.FillRectangle (new Cairo.Rectangle (x, y, grid_width, grid_width), gray);
}
}
示例3: DrawShape
protected override Rectangle DrawShape(Rectangle rect, Layer l)
{
Document doc = PintaCore.Workspace.ActiveDocument;
Rectangle dirty;
using (Context g = new Context (l.Surface)) {
g.AppendPath (doc.SelectionPath);
g.FillRule = FillRule.EvenOdd;
g.Clip ();
g.Antialias = UseAntialiasing ? Antialias.Subpixel : Antialias.None;
if (FillShape && StrokeShape)
dirty = g.FillStrokedRectangle (rect, fill_color, outline_color, BrushWidth);
else if (FillShape)
dirty = g.FillRectangle (rect, outline_color);
else
dirty = g.DrawRectangle (rect, outline_color, BrushWidth);
}
return dirty;
}
示例4: OnAfterDraw
public override void OnAfterDraw(Context c)
{
if(currentSection != null)
c.FillRectangle (currentSection.GripperAbsoluteBound, currentSection.SectionGripperColor);
}