- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
if ((pen == true) || (brush == true))
{
mousePath = new System.Drawing.Drawing2D.GraphicsPath();
myPaths.Add(mousePath);
}
else
if ((rectangle == true) && (e.X > 0) && (e.Y > 0) && (e.X < pictureBox1.Width)
&& (e.Y < pictureBox1.Height))
{
if (Border == true)
{
PenForBrush.Width = trackBar1.Value;
if ((e.X >= rectX) && (e.Y >= rectY))
{
g.DrawRectangle(PenForBrush, rectX, rectY, e.X - rectX, e.Y - rectY);
}
else
if ((e.X <= rectX) && (e.Y <= rectY))
{
Rectangle R = new Rectangle(e.X, e.Y, rectX - e.X, rectY - e.Y);
g.DrawRectangle(PenForBrush, R);
}
else
if ((e.X <= rectX) && (e.Y >= rectY))
{
Rectangle R = new Rectangle(e.X, rectY, rectX - e.X, e.Y - rectY);
g.DrawRectangle(PenForBrush, R);
}
else
if ((e.X >= rectX) && (e.Y <= rectY))
{
Rectangle R = new Rectangle(rectX, e.Y, e.X - rectX, rectY - e.Y);
g.DrawRectangle(PenForBrush, R);
}
}
else if (FillBorder == true)
{
else
if ((e.X <= rectX) && (e.Y <= rectY))
{
Rectangle R = new Rectangle(e.X + width, e.Y + width,
rectX - e.X - trackBar1.Value, rectY - e.Y - trackBar1.Value);
g.FillRectangle(FillBrush, R);
g.DrawRectangle(PenForBrush, e.X, e.Y, rectX - e.X, rectY - e.Y);
}
else
if ((e.X <= rectX) && (e.Y >= rectY))
{
Rectangle R = new Rectangle(e.X + width, rectY + width,
rectX - e.X - trackBar1.Value, e.Y - rectY - trackBar1.Value);
g.FillRectangle(FillBrush, R);
g.DrawRectangle(PenForBrush, e.X, rectY, rectX - e.X, e.Y - rectY);
}
else
if ((e.X >= rectX) && (e.Y <= rectY))
{
Rectangle R = new Rectangle(rectX + width, e.Y + width,
e.X - rectX - trackBar1.Value, rectY - e.Y - trackBar1.Value);
g.FillRectangle(FillBrush, R);
g.DrawRectangle(PenForBrush, rectX, e.Y, e.X - rectX, rectY - e.Y);
}
}
else if ((mark == true) && (!IsMarkPaint)
&& (e.X - distance1 > 0) && (e.Y - distance2 > 0)
&& (e.X + distance3 < pictureBox1.Width) && (e.Y + distance4 < pictureBox1.Height))
{
if (Count == 0)
{
try
{
Rectangle R = new Rectangle(PreviousMarkPoint.X, PreviousMarkPoint.Y,
MarkRectangle.Width, MarkRectangle.Height);
SolidBrush s = new SolidBrush(Color.White);
g.FillRectangle(s, R);
Bitmap temp = new Bitmap(pictureBox1.Image.Width, pictureBox1.Image.Height);
temp = (Bitmap)pictureBox1.Image;
ImageClone = temp.Clone(MarkRectangle, PixelFormat.Format16bppArgb1555);
}
catch { }
if (myImages.Count > 35)
{
myImages.RemoveAt(0);
ImageNames.RemoveAt(0);
}