private void resetCanvasState() { if (CanvasManager.FirstPointPlaced) { CanvasManager.FirstPointPlaced = false; CanvasManager.NewFigure = null; } this.Cursor = CustomCursors.loadCursor(CanvasState.None); Properties.Settings.Default.CanvasState = (int)CanvasState.None; }
public FrmMain() { InitializeComponent(); MaterialSkinManager SkinManager = MaterialSkinManager.Instance; SkinManager.AddFormToManage(this); SkinManager.Theme = MaterialSkinManager.Themes.LIGHT; SkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE); CustomCursors.createCursors(this); }
/// <summary> /// Method fires when we are closing out of the editor, want to clean up all our objects. /// </summary> public override void ShutDown() { base.ShutDown(); MoveAll = null; ExecuteMove = null; OffsetX = null; OffsetY = null; if (_grabbingCursor != null) { CustomCursors.DestroyCreatedCursor(_grabCursorHandle); _grabbingCursor.Dispose(); _grabbingCursor = null; } }
/// <summary> /// Creates a custom cursor for this tool, based on a base image, with another image in the upper right corner /// </summary> /// <param name="baseImage">Basic image to create the cursor</param> /// <param name="modifierImage">If present, an additional image place in the upper right hand corner</param> /// <param name="hotspot">Position of the cursor's hotspot</param> /// <returns>A cursor created from the composite of the images.</returns> protected virtual Cursor CreateCursor(Bitmap baseImage, Bitmap modifierImage, Point hotspot) { using (Bitmap Base = new Bitmap(baseImage)) { using (Graphics g = Graphics.FromImage(Base)) { if (modifierImage != null) { g.DrawImage(modifierImage, Base.Width - modifierImage.Width, 0, modifierImage.Width, modifierImage.Height); } } var NewCursor = CustomCursors.CreateCursor(Base, hotspot.X, hotspot.Y); _cursorHandle = NewCursor.Handle; return(NewCursor); } }
/// <summary> /// Method fires when we are closing out of the editor, want to clean up all our objects. /// </summary> public virtual void ShutDown() { // Remove all event delegates from their associated events. AttachEvents(false); if (this.Cursor != null) { CustomCursors.DestroyCreatedCursor(_cursorHandle); this.Cursor?.Dispose(); } _canvasControlGraphics?.Dispose(); _latticeBufferGraphics?.Dispose(); _latticeBuffer?.Dispose(); _capturedCanvas?.Dispose(); _shutDown = true; }
private void ToolsRotate_Click(object sender, EventArgs e) { Properties.Settings.Default.CanvasState = (int)CanvasState.Rotating; this.Cursor = CustomCursors.loadCursor(CanvasState.Rotating);; }
private void ToolsCircle_Click(object sender, EventArgs e) { Properties.Settings.Default.CanvasState = (int)CanvasState.CreatingCircle; this.Cursor = CustomCursors.loadCursor(CanvasState.CreatingCircle); }