當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。