本文整理汇总了C#中Pinta.Core.Layer类的典型用法代码示例。如果您正苦于以下问题:C# Layer类的具体用法?C# Layer怎么用?C# Layer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Layer类属于Pinta.Core命名空间,在下文中一共展示了Layer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetProperties
public void SetProperties (Layer layer)
{
layer.Name = Name;
layer.Opacity = Opacity;
layer.Hidden = Hidden;
layer.BlendMode = BlendMode;
}
示例2: 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.Selection.SelectionPath);
g.FillRule = FillRule.EvenOdd;
g.Clip ();
g.Antialias = UseAntialiasing ? Antialias.Subpixel : Antialias.None;
dirty = rect;
if (FillShape && StrokeShape)
dirty = g.FillStrokedEllipse (rect, fill_color, outline_color, BrushWidth);
else if (FillShape)
dirty = g.FillEllipse (rect, outline_color);
else
dirty = g.DrawEllipse (rect, outline_color, BrushWidth);
}
return dirty;
}
示例3: Redo
public override void Redo()
{
// Store the layer for "undo"
layer = PintaCore.Layers[layer_index];
PintaCore.Layers.DeleteLayer (layer_index, false);
}
示例4: DrawShape
protected override Rectangle DrawShape(Rectangle r, Layer l)
{
Document doc = PintaCore.Workspace.ActiveDocument;
doc.Selection.CreateEllipseSelection(l.Surface, r);
return r;
}
示例5: DrawShape
protected override Rectangle DrawShape(Rectangle r, Layer l)
{
Document doc = PintaCore.Workspace.ActiveDocument;
doc.Selection.CreateRectangleSelection(l.Surface, r);
// Add some padding for invalidation
return new Rectangle (r.X, r.Y, r.Width + 2, r.Height + 2);
}
示例6: Undo
public override void Undo()
{
PintaCore.Layers.Insert (layer, layer_index);
// Make new layer the current layer
PintaCore.Layers.SetCurrentLayer (layer);
layer = null;
}
示例7: DrawShape
protected override Rectangle DrawShape(Rectangle r, Layer l)
{
Path path = PintaCore.Layers.SelectionPath;
using (Context g = new Context (l.Surface))
PintaCore.Layers.SelectionPath = g.CreateEllipsePath (r);
(path as IDisposable).Dispose ();
return r;
}
示例8: DrawShape
protected override Rectangle DrawShape(Rectangle r, Layer l)
{
Path path = PintaCore.Layers.SelectionPath;
using (Context g = new Context (l.Surface))
PintaCore.Layers.SelectionPath = g.CreateRectanglePath (r);
(path as IDisposable).Dispose ();
// Add some padding for invalidation
return new Rectangle (r.X, r.Y, r.Width + 2, r.Height + 2);
}
示例9: DrawShape
protected override Rectangle DrawShape(Rectangle r, Layer l)
{
Document doc = PintaCore.Workspace.ActiveDocument;
Path path = doc.SelectionPath;
using (Context g = new Context (l.Surface))
doc.SelectionPath = g.CreateEllipsePath (r);
(path as IDisposable).Dispose ();
return r;
}
示例10: 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.Selection.SelectionPath);
g.FillRule = FillRule.EvenOdd;
g.Clip ();
g.Antialias = UseAntialiasing ? Antialias.Subpixel : Antialias.None;
dirty = g.DrawLine (shape_origin, current_point , outline_color, BrushWidth);
}
return dirty;
}
示例11: Document
public Document(Gdk.Size size)
{
Guid = Guid.NewGuid ();
Workspace = new DocumentWorkspace (this);
IsDirty = false;
HasFile = false;
ImageSize = size;
Layers = new List<Layer> ();
tool_layer = CreateLayer ("Tool Layer");
tool_layer.Hidden = true;
selection_layer = CreateLayer ("Selection Layer");
selection_layer.Hidden = true;
ResetSelectionPath ();
}
示例12: 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;
}
示例13: DrawShape
/// <summary>
/// Override this to implement features on shift, like line snapping.
/// </summary>
protected virtual Rectangle DrawShape(Rectangle r, Layer l, bool shiftkey_pressed)
{
return DrawShape (r, l);
}
示例14: SetCurrentLayer
public void SetCurrentLayer(Layer layer)
{
current_layer = Layers.IndexOf (layer);
PintaCore.Layers.OnSelectedLayerChanged ();
}
示例15: CreateSelectionLayer
public void CreateSelectionLayer (int width, int height)
{
Layer old = selection_layer;
selection_layer = CreateLayer (width, height);
if (old != null)
(old.Surface as IDisposable).Dispose ();
}