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

ResetSelectionPaths() public method

public ResetSelectionPaths ( ) : void
return void
        public void ResetSelectionPaths()
        {
            var rect = new Cairo.Rectangle (0, 0, ImageSize.Width, ImageSize.Height);
            Selection.CreateRectangleSelection (rect);
            PreviousSelection.CreateRectangleSelection (rect);

            ShowSelection = false;
        }

Usage Example

Example #1
0
		static void CropImageToRectangle (Document doc, Gdk.Rectangle rect, Path selection)
		{
			if (rect.Width > 0 && rect.Height > 0)
			{
				ResizeHistoryItem hist = new ResizeHistoryItem(doc.ImageSize);

				hist.Icon = "Menu.Image.Crop.png";
				hist.Text = Catalog.GetString("Crop to Selection");
				hist.StartSnapshotOfImage();
				hist.RestoreSelection = doc.Selection.Clone();

				doc.Workspace.Canvas.GdkWindow.FreezeUpdates();

				double original_scale = doc.Workspace.Scale;
				doc.ImageSize = rect.Size;
				doc.Workspace.CanvasSize = rect.Size;
				doc.Workspace.Scale = original_scale;

				PintaCore.Actions.View.UpdateCanvasScale();

				doc.Workspace.Canvas.GdkWindow.ThawUpdates();

				foreach (var layer in doc.UserLayers)
                    layer.Crop (rect, selection);

				hist.FinishSnapshotOfImage();

				doc.History.PushNewItem(hist);
				doc.ResetSelectionPaths();

				doc.Workspace.Invalidate();
			}
		}
All Usage Examples Of Pinta.Core.Document::ResetSelectionPaths