private void Stage_MouseUp(object sender, MouseEventArgs e)
{
this.timerSet.Enabled = false;
if (buttonCover.Checked) {
this.boxPreview.Visible = false;
g.FillRectangle(new SolidBrush(currentColor), previewRect);
}
if (buttonCrop.Checked) {
this.boxPreview.Visible = false;
if (this.previewRect.Width > 0 && this.previewRect.Height > 0) {
Bitmap cropBmp = new Bitmap(this.previewRect.Width, this.previewRect.Height);
Graphics cropGfx = Graphics.FromImage(cropBmp);
cropGfx.DrawImage(this.img, new Point(-this.previewRect.X, -this.previewRect.Y));
this.img = cropBmp;
this.g = cropGfx;
}
}
if (buttonText.Checked) {
this.previewStart = new Point(e.X, e.Y);
toolStrip.Enabled = false;
textPreview.Location = new Point(this.previewStart.X, this.previewStart.Y + this.Stage.Top);
textPreview.Width = this.img.Width - textPreview.Left;
textPreview.Font = this.currentFont;
textPreview.Visible = true;
textPreview.Focus();
}
if (buttonDraw.Checked) {
this.drawLines.Add(new Point(e.X, e.Y));
timerSet_Tick(null, null);
}
this.Stage.Image = img;
}