예제 #1
0
 private void mainImage_MouseDown(object sender, MouseButtonEventArgs e)
 {
     Drawing = true;
     if (SelectedTool is SaveBitmapTool)
     {
         if (temporaryBitmap != null)
         {
             temporaryBitmap.Dispose();
             temporaryBitmap = null;
         }
         temporaryBitmap = new Bitmap(SelectedLayer.Bitmap);
     }
     if (SelectedLayer != null)
     {
         SelectedTool.BeginDrawing(SelectedLayer.Bitmap, GetPoint(e));
     }
 }
예제 #2
0
        private void mainImage_MouseMove(object sender, MouseEventArgs e)
        {
            var point = GetPoint(e);

            mainImageCursorPosition.Text = "Pos: " + point.X.ToString() + ", " + point.Y + "px";

            if (SelectedLayer != null && Drawing && !SelectedLayer.Locked)
            {
                if (SelectedTool is SaveBitmapTool)
                {
                    SelectedLayer.Bitmap.Dispose();
                    SelectedLayer.Bitmap = new Bitmap(temporaryBitmap);
                    SelectedTool.BeginDrawing(SelectedLayer.Bitmap, SelectedTool.initialPoint);
                }
                SelectedTool.DrawStep(SelectedLayer.Bitmap, point);
                Draw();
            }
        }