DrawWithOperator() public method

public DrawWithOperator ( Context ctx, ImageSurface surface, Operator op, double opacity = 1.0, bool transform = true ) : void
ctx Context
surface Cairo.ImageSurface
op Operator
opacity double
transform bool
return void
Beispiel #1
0
        // Called from asynchronously from Renderer.OnCompletion ()
        void HandleApply()
        {
            Debug.WriteLine("LivePreviewManager.HandleApply()");

            using (var ctx = new Cairo.Context(layer.Surface)) {
                ctx.Save();
                PintaCore.Workspace.ActiveDocument.Selection.Clip(ctx);

                layer.DrawWithOperator(ctx, live_preview_surface, Cairo.Operator.Source);
                ctx.Restore();
            }

            PintaCore.Workspace.ActiveDocument.History.PushNewItem(history_item);
            history_item = null !;

            FireLivePreviewEndedEvent(RenderStatus.Completed, null);

            live_preview_enabled = false;

            PintaCore.Workspace.Invalidate();              //TODO keep track of dirty bounds.
            CleanUp();
        }
Beispiel #2
0
        public void FinishSelection()
        {
            // We don't have an uncommitted layer, abort
            if (!ShowSelectionLayer)
            {
                return;
            }

            FinishPixelsHistoryItem hist = new FinishPixelsHistoryItem();

            hist.TakeSnapshot();

            Layer layer = SelectionLayer;

            using (Cairo.Context g = new Cairo.Context(CurrentUserLayer.Surface)) {
                selection.Clip(g);
                layer.DrawWithOperator(g, layer.Surface, Operator.Source, 1.0f, true);
            }

            DestroySelectionLayer();
            Workspace.Invalidate();

            Workspace.History.PushNewItem(hist);
        }