Pinta.Core.Document.CreateSelectionLayer C# (CSharp) Method

CreateSelectionLayer() public method

public CreateSelectionLayer ( ) : void
return void
        public void CreateSelectionLayer()
        {
            Layer old = selection_layer;

            selection_layer = CreateLayer ();

            if (old != null)
                (old.Surface as IDisposable).Dispose ();
        }

Same methods

Document::CreateSelectionLayer ( int width, int height ) : void

Usage Example

Example #1
0
        public override void Redo()
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            // Copy the paste to the temp layer
            doc.CreateSelectionLayer();
            doc.ShowSelectionLayer = true;

            using (Cairo.Context g = new Cairo.Context(doc.SelectionLayer.Surface)) {
                g.DrawPixbuf(paste_image, new Cairo.Point(0, 0));
            }

            Swap();

            PintaCore.Workspace.Invalidate();
            PintaCore.Tools.SetCurrentTool(Catalog.GetString("Move Selected Pixels"));
        }
All Usage Examples Of Pinta.Core.Document::CreateSelectionLayer