Pinta.Core.SimpleHistoryItem.TakeSnapshotOfLayer C# (CSharp) Метод

TakeSnapshotOfLayer() публичный Метод

public TakeSnapshotOfLayer ( Layer layer ) : void
layer Layer
Результат void
        public void TakeSnapshotOfLayer(Layer layer)
        {
            layer_index = PintaCore.Layers.IndexOf (layer);;
            old_surface = layer.Surface.Clone ();
        }

Same methods

SimpleHistoryItem::TakeSnapshotOfLayer ( int layerIndex ) : void

Usage Example

Пример #1
0
		// Called from asynchronously from Renderer.OnCompletion ()
		void HandleApply ()
		{
			Debug.WriteLine ("LivePreviewManager.HandleApply()");

			var item = new SimpleHistoryItem (effect.Icon, effect.Name);
			item.TakeSnapshotOfLayer (PintaCore.Layers.CurrentLayerIndex);			
			
			using (var ctx = new Cairo.Context (layer.Surface)) {
				
				ctx.Save ();
				ctx.AppendPath (PintaCore.Layers.SelectionPath);
				ctx.FillRule = Cairo.FillRule.EvenOdd;
				ctx.Clip ();				
			
				ctx.Operator = Cairo.Operator.Source;
				
				ctx.SetSourceSurface (live_preview_surface, (int)layer.Offset.X, (int)layer.Offset.Y);
				ctx.Paint ();
				ctx.Restore ();
			}
			
			PintaCore.History.PushNewItem (item);
			
			FireLivePreviewEndedEvent(RenderStatus.Completed, null);
			
			live_preview_enabled = false;
			
			PintaCore.Workspace.Invalidate (); //TODO keep track of dirty bounds.
			CleanUp ();
		}
All Usage Examples Of Pinta.Core.SimpleHistoryItem::TakeSnapshotOfLayer