当前位置: 首页>>代码示例>>C#>>正文


C# Core.Layer类代码示例

本文整理汇总了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;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:7,代码来源:LayerProperties.cs

示例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;
        }
开发者ID:JoeyScarr,项目名称:Pinta,代码行数:25,代码来源:EllipseTool.cs

示例3: Redo

        public override void Redo()
        {
            // Store the layer for "undo"
            layer = PintaCore.Layers[layer_index];

            PintaCore.Layers.DeleteLayer (layer_index, false);
        }
开发者ID:RudoCris,项目名称:Pinta,代码行数:7,代码来源:DeleteLayerHistoryItem.cs

示例4: DrawShape

        protected override Rectangle DrawShape(Rectangle r, Layer l)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            doc.Selection.CreateEllipseSelection(l.Surface, r);

            return r;
        }
开发者ID:Kharevich,项目名称:Pinta,代码行数:8,代码来源:EllipseSelectTool.cs

示例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);
        }
开发者ID:bodicsek,项目名称:Pinta,代码行数:9,代码来源:RectangleSelectTool.cs

示例6: Undo

        public override void Undo()
        {
            PintaCore.Layers.Insert (layer, layer_index);

            // Make new layer the current layer
            PintaCore.Layers.SetCurrentLayer (layer);

            layer = null;
        }
开发者ID:RudoCris,项目名称:Pinta,代码行数:9,代码来源:DeleteLayerHistoryItem.cs

示例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;
        }
开发者ID:asbjornu,项目名称:Pinta,代码行数:11,代码来源:EllipseSelectTool.cs

示例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);
        }
开发者ID:xxgreg,项目名称:Pinta,代码行数:12,代码来源:RectangleSelectTool.cs

示例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;
        }
开发者ID:jobernolte,项目名称:Pinta,代码行数:13,代码来源:EllipseSelectTool.cs

示例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;
        }
开发者ID:bodicsek,项目名称:Pinta,代码行数:18,代码来源:LineCurveTool.cs

示例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 ();
        }
开发者ID:linuxmhall,项目名称:Pinta,代码行数:19,代码来源:Document.cs

示例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;
        }
开发者ID:joehillen,项目名称:Pinta,代码行数:21,代码来源:RectangleTool.cs

示例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);
 }
开发者ID:Kharevich,项目名称:Pinta,代码行数:7,代码来源:ShapeTool.cs

示例14: SetCurrentLayer

        public void SetCurrentLayer(Layer layer)
        {
            current_layer = Layers.IndexOf (layer);

            PintaCore.Layers.OnSelectedLayerChanged ();
        }
开发者ID:linuxmhall,项目名称:Pinta,代码行数:6,代码来源:Document.cs

示例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 ();
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:9,代码来源:Document.cs


注:本文中的Pinta.Core.Layer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。