public DrawWithOperator ( Context ctx, |
||
ctx | Context | |
surface | ||
op | Operator | |
opacity | double | |
transform | bool | |
Résultat | void |
// 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(); }
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); }