none
zoom window for a vector graphics filled 90% of picturebox2 and picturebox2 is of limited size (591 x 486 pix) and all the verctors is drawn function to picture box 2 size RRS feed

  • Question

  • Hi,

    I have the following code which zoom window for a vector graphics filled 90% of picturebox2.

    The form contain checkbox of name ZoomCb

    The code does not draw the rectangle of zoom while I see that I have not mistake

    Just copy the code into empty form. picture box2 size (593 x 486)

    Private Sub PictureBox2_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox2.Paint
    Private ScaleWidth As Single = 100000
        Private ScaleRatio As Single = 1
        Private Yoffset As Single
        Private Corner As New Point(0, 0)
        Private GridStep As Single = ScaleWidth / 5
        Private MouseDownPt, MouseMovePt, ZoomMouseDownPt, ZoomMouseMovePt As PointF
        Private MouseStatus As Integer
        Private dx As Integer
        Private dy As Integer
        Private ToolCbCancel As Boolean = False
    Xcoor(0)=200
    Xcoor(1)=200
    Xcoor(2)=-200
    Xcoor(3)=-200
    Ycoor(0)=-350
    Ycoor(1)=350
    Ycoor(2)=350
    Ycoor(3)=-350
    coorx1(0)=141
    coorx1(1)=141
    coorx1(2)=141
    coorx1(3)=141
    coorx1(4)=0
    coorx1(5)=-141
    coorx1(6)=-141
    coorx1(7)=-141
    coorx1(8)=-141
    coorx1(9)=-141
    coorx1(10)=0
    coorx1(11)=141
    coory1(0)=-145.5
    coory1(1)=0
    coory1(2)=145.5
    coory1(3)=291
    coory1(4)=291
    coory1(5)=291
    coory1(6)=145.5
    coory1(7)=0
    coory1(8)=-145.5
    coory1(9)=-291
    coory1(10)=-291
    coory1(11)=-291
    Xmax=200
    Xmin=-200
    Ymax=350
    Ymin=-350
    Numcoor=4
    Numbarcoor=12
    Dim vv As Integer
            Dim YY As Integer
            b = Xmax - Xmin
            t = Ymax - Ymin
    Dim sf As Single = CSng(PictureBox2.ClientSize.Width / (ScaleRatio * ScaleWidth))
            e.Graphics.ScaleTransform(sf, sf)
            e.Graphics.TranslateTransform(-Corner.X, -Corner.Y)
            If MouseStatus = 3 Or MouseStatus = 1 Then
                If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width)
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf))
                    X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf))
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b))
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf))
                    Y5a = CInt((PictureBox2.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t))
                End If
                Dim points1(Numcoor - 1) As Point
                For vv = 0 To points1.Length - 1
                    points1(vv).X = CInt(Xcoor11(vv))
                    points1(vv).Y = CInt(Ycoor11(vv))
                Next
                'e.Graphics.FillPolygon(mbrush1, points1)
                e.Graphics.DrawPolygon(mpen3, points1)
                e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                Dim DrawFont9 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular)
                Dim DrawFont6 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular)
                e.Graphics.DrawString(Str3, DrawFont9, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf))
                e.Graphics.DrawString(Str4, DrawFont9, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf))
                Dim Str As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush As New SolidBrush(Color.Black)
                Dim textSize72 As SizeF
                textSize72 = G.MeasureString(Str, DrawFont9)
                XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize72.Width)) / 2)
                e.Graphics.DrawString(Str, DrawFont9, Brush, XQQ17, CInt(0.87 * PictureBox2.ClientSize.Height / sf))
                If NumBarcoor >= 1 Then
                    If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    End If
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont9)
                    XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2)
                    e.Graphics.DrawString(Str1, DrawFont9, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf))
                End If
            ElseIf MouseStatus = 0 Then
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width)
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf))
                    X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf))
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b))
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf))
                    Y5a = CInt((PictureBox2.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t))
                End If
                Dim points11(Numcoor - 1) As Point
                For vv = 0 To points11.Length - 1
                    points11(vv).X = CInt(Xcoor11(vv))
                    points11(vv).Y = CInt(Ycoor11(vv))
                Next
                'e.Graphics.FillPolygon(mbrush1, points1)
                e.Graphics.DrawPolygon(mpen3, points11)
                e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                Dim DrawFont99 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular)
                e.Graphics.DrawString(Str3, DrawFont99, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf))
                e.Graphics.DrawString(Str4, DrawFont99, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf))
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99)
                XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize726.Width)) / 2)
                e.Graphics.DrawString(Str66, DrawFont99, Brush, XQQ17, CInt(0.87 * PictureBox2.ClientSize.Height / sf))
                If NumBarcoor >= 1 Then
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    End If
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99)
                    XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2)
                    e.Graphics.DrawString(Str1, DrawFont99, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf))
                End If
            End If
            If MouseStatus = 1 Then
                If ZoomCb.Checked Then
                    'convert for positive yaxis and rectf
                    Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y) - CInt(ZoomMouseMovePt.Y))
                    e.Graphics.DrawRectangle(Pens.Red, rect)
                Else
                    'draw other tracers if active
                End If
            End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Form32Irregular_byCoordinates_Resize(0, Nothing)
            PictureBox2.Focus()
            MouseStatus = 3
        End Sub
        Private Sub Form32Irregular_byCoordinates_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            Yoffset = Convert.ToSingle(ScaleWidth * (PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width))
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseDown
            Dim pt As PointF = GetScalePtFromClientPt(e.Location)
            If ZoomCb.Checked Then
                'keep zoom independant of drawing tools to allow nesting of zoom with tools.
                ZoomMouseDownPt = pt
                ZoomMouseMovePt = ZoomMouseDownPt
            End If
            MouseStatus = 1
            MouseMovePt = pt
            PictureBox2.Invalidate()
            PictureBox2.Focus()
        End Sub
        Private Sub Picturebox2_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseMove
            Dim pt As PointF = GetScalePtFromClientPt(e.Location)
            If MouseStatus = 1 Then
                If ZoomCb.Checked Then
                    ZoomMouseMovePt = pt
                    PictureBox2.Invalidate()
                End If
            End If
        End Sub
        Private Sub Picturebox2_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseUp
            Dim pt As PointF = GetScalePtFromClientPt(e.Location)
            If ZoomCb.Checked Then
                ZoomMouseMovePt = pt
                ZoomCb.Checked = False
                'set scale based on zoom rect
                Select Case MouseStatus
                    Case 1
                        ZoomMouseMovePt = pt
                        ZoomCb.Checked = False
                        'set scale based on zoom rect width
                        dx = CInt(ZoomMouseMovePt.X - ZoomMouseDownPt.X)
                        dy = CInt(ZoomMouseMovePt.Y - ZoomMouseDownPt.Y)
                        ScaleWidth = dx
                        'set origin
                        Corner.X = CInt(ZoomMouseDownPt.X)
                        Corner.Y = CInt(ZoomMouseDownPt.Y)
                        'update yoffset etc
                        Form32Irregular_byCoordinates_Resize(0, Nothing)
                End Select
            End If
            MouseStatus = 0
            PictureBox2.Invalidate()
        End Sub
        Private Function GetScalePtFromClientPt(pt As PointF) As PointF
            'convert screen pixels to scale drawing coords
            Dim sf As Double = PictureBox2.ClientSize.Width / (ScaleWidth * ScaleRatio)
            Return New PointF(CSng(Corner.X + (pt.X / sf)), CSng(Corner.Y + (pt.Y / sf)))
        End Function
        Private Sub Picturebox2_MouseWheel(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseWheel
            ScaleRatio += CSng(Math.Sign(e.Delta) * 0.1)
            If ScaleRatio < 0.000001 Then ScaleRatio = 0.000001
            If ScaleRatio > 10000 Then ScaleRatio = 10000
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter
            PictureBox2.Focus()
        End Sub


    Hany Metry





    • Edited by Hany Metry Sunday, November 24, 2019 5:49 AM
    Tuesday, November 19, 2019 6:18 PM

Answers

  • Hi All,

    Below is the final answer after tested and checked.

    Picture box2.client.width = 591 pix

    Picture box2.client.height = 486 pix

    there is checkbox1 to zoom out (back the drawing to its original size)

    There is a checkbox of name ZoomCb to start zoom.

    Public Class Form32Irregular_byCoordinates
        Private ScaleWidth As Single = 591
        Private ScaleRatio As Single = 1
        Private Yoffset As Single
        Private Corner As New Point(0, 0)
        Private GridStep As Single = ScaleWidth / 5
        Private MouseDownPt, MouseMovePt, ZoomMouseDownPt, ZoomMouseMovePt As PointF
        Private YQQ17 As Integer
        Private YQQ11 As Integer
        Private MouseStatus As Integer
        Private dx As Integer
        Private dy As Integer
        Private sf1 As Double
        Private ToolCbCancel As Boolean = False
        Private Soso As Integer = 1
        Private Titi As Integer = 1
        Private Yint As Double
        Private Xint As Double
        Private Xint2 As Double
        Private Yint2 As Double
    Private Sub PictureBox2_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox2.Paint
           
            Dim vv As Integer
            Dim YY As Integer
            b = Xmax - Xmin
            t = Ymax - Ymin
            Dim sf As Single = CSng(PictureBox2.ClientSize.Width / (ScaleRatio * ScaleWidth))
            e.Graphics.ScaleTransform(sf, sf)
            If ((MouseStatus = 3 Or MouseStatus = 1) And Soso <> 2 And Titi <> 2) Or CheckBox1.Checked = True Then
                e.Graphics.TranslateTransform(-Corner.X, -Corner.Y)
                e.Graphics.Clear(Color.White)
                If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width / sf)
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf))
                    X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf))
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                End If
                Dim points1(Numcoor - 1) As Point
                For vv = 0 To points1.Length - 1
                    points1(vv).X = CInt(Xcoor11(vv))
                    points1(vv).Y = CInt(Ycoor11(vv))
                Next
                e.Graphics.DrawPolygon(mpen3, points1)
                e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                Dim DrawFont9 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular)
                Dim DrawFont6 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular)
                e.Graphics.DrawString(Str3, DrawFont9, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf))
                e.Graphics.DrawString(Str4, DrawFont9, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf))
                Dim Str As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush As New SolidBrush(Color.Black)
                Dim textSize72 As SizeF
                textSize72 = G.MeasureString(Str, DrawFont9)
                XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize72.Width)) / 2)
                e.Graphics.DrawString(Str, DrawFont9, Brush, XQQ17, YQQ17)
                If NumBarcoor >= 1 Then
                    If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    End If
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont9)
                    XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2)
                    e.Graphics.DrawString(Str1, DrawFont9, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf))
                End If
            ElseIf MouseStatus = 0 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                e.Graphics.Clear(Color.White)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width) * 0.075 + (((Xcoor11(vv) - ZoomMouseDownPt.X)) * (PictureBox2.ClientSize.Width * 0.85) / dx))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X3a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    X4a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X4a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    X5a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X5a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    sf1 = dx / (PictureBox2.ClientSize.Width * 0.85)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width) + ((-Convert.ToDouble(dx) / 2 + Xcoor11(vv) - ZoomMouseDownPt.X) / Convert.ToDouble(dy)) * 0.85 * (PictureBox2.ClientSize.Height))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X3a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X4a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X5a - ZoomMouseDownPt.X) / dy) * (0.85 * PictureBox2.ClientSize.Height))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.Height) / Convert.ToDouble(dy))
                    sf1 = dy / (PictureBox2.ClientSize.Height * 0.85)
                End If
                Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 32
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 34
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 33
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 35
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 32
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 34
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 33
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 35
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    34:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    35:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    32:                 Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    33:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 20
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 21
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 22
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 23
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
    23:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    22:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
    21:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    20:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    17:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Xint2 = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    18:                 Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Xint2 = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    24:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    25:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 1000
                    End If
    1000:           OO = I
                Next
               
            

    Post 1


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:02 PM
    Monday, November 25, 2019 11:54 AM
  • Post 2 of final code

    If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 134
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 135
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 134
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 135
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    134:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    135:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    132:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    133:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    123:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
    122:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    121:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
    120:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                    GoTo 2000
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    117:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Xint2 = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    118:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Xint2 = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    124:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    125:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 2000
                End If
    2000:       If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    XQQ17 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ17 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                Else
                    XQQ17 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ17 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                End If
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Width) * 0.85 / Convert.ToSingle(dx))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width) * 0.075 + ((coorXf1(YY) - ZoomMouseDownPt.X) / Convert.ToDouble(dx)) * 0.85 * (PictureBox2.ClientSize.Width))
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Height) * 0.85 / Convert.ToSingle(dy))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width + ((-dx / 2 + coorXf1(YY) - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-dy / 2 + coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / (dy))
                        Next
                    End If
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        XQQ11 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ11 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Else
                        XQQ11 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ11 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    End If
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
                Titi = 2
            ElseIf MouseStatus = 1 And Titi = 2 And ZoomCb.Checked = True Then
                Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 232
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 234
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 233
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 235
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 232
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 234
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 233
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 235
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    234:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    235:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    232:                Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    233:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 220
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 221
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 222
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 223
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
    223:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    222:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
    221:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    220:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    217:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Xint2 = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    218:                Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Xint2 = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    224:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    225:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 3000
                    End If
    3000:           OO = I
                Next
                

    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 11:58 AM
  • Post 3
    If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1134
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1135
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1134
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1135
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    1134:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    1135:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    1132:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    1133:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    1123:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
    1122:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    1121:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
    1120:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                    GoTo 4000
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    1117:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Xint2 = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    1118:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Xint2 = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    1124:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    1125:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 4000
                End If
    4000:       If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
            End If
            If MouseStatus = 1 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                If ZoomCb.Checked = True Then
                    'convert for positive yaxis and rectf
                    With e.Graphics
                        Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), Math.Max(CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), 1), Math.Max(CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y), 1))
                        .DrawRectangle(Pens.Red, rect)
                    End With
                Else
                    'draw other tracers if active
                End If
            End If
            'End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Form32Irregular_byCoordinates_Resize(0, Nothing)
            'PictureBox2.Invalidate()
            PictureBox2.Focus()
            MouseStatus = 3
            Soso = 1
        End Sub
        Private Sub Form32Irregular_byCoordinates_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            'Yoffset = Convert.ToSingle(ScaleWidth * (PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width))
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseDown
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                'keep zoom independant of drawing tools to allow nesting of zoom with tools.
                ZoomMouseDownPt = pt
                ZoomMouseMovePt = ZoomMouseDownPt
            End If
            MouseStatus = 1
            MouseMovePt = pt
            PictureBox2.Invalidate()
            PictureBox2.Focus()
        End Sub
        Private Sub Picturebox2_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseMove
            Dim pt As PointF = e.Location
            If MouseStatus = 1 Then
                If ZoomCb.Checked = True Then
                    ZoomMouseMovePt = pt
                    PictureBox2.Invalidate()
                End If
            End If
        End Sub
        Private Sub Picturebox2_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseUp
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                ZoomMouseMovePt = pt
                'ZoomCb.Checked = False
                'set scale based on zoom rect
                Select Case MouseStatus
                    Case 1
                        ZoomMouseMovePt = pt
                        'ZoomCb.Checked = False
                        'set scale based on zoom rect width
                        dx = CInt(ZoomMouseMovePt.X - ZoomMouseDownPt.X)
                        dy = CInt(ZoomMouseMovePt.Y - ZoomMouseDownPt.Y)
                        If dx < 1 Then
                            dx = 1
                        End If
                        If dy < 1 Then
                            dy = 1
                        End If
                        'ScaleWidth = dx
                        'set origin
                        'Corner.X = CInt(ZoomMouseDownPt.X)
                        'Corner.Y = CInt(ZoomMouseDownPt.Y)
                        'update yoffset etc
                        'PictureBox2.Invalidate()
                        Form32Irregular_byCoordinates_Resize(0, Nothing)
                End Select
            End If
            Soso = 2
            Titi = 1
            MouseStatus = 0
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter
            PictureBox2.Focus()
        End Sub
        Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
            If CheckBox1.Checked = True Then
                MouseStatus = 3
                Corner.X = 0
                Corner.Y = 0
                ScaleWidth = 591
                PictureBox2.Invalidate()
                CheckBox1.Checked = False
                ZoomCb.Checked = False
                Soso = 1
                Titi = 1
            End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
            Me.Hide()
        End Sub
    End Class


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 12:00 PM
  • Post 4

    Below is the value of variables if any one want to test the code.

    Xcoor(0)=200
    Xcoor(1)=200
    Xcoor(2)=-200
    Xcoor(3)=-200
    Ycoor(0)=-350
    Ycoor(1)=350
    Ycoor(2)=350
    Ycoor(3)=-350
    coorx1(0)=141
    coorx1(1)=141
    coorx1(2)=141
    coorx1(3)=141
    coorx1(4)=0
    coorx1(5)=-141
    coorx1(6)=-141
    coorx1(7)=-141
    coorx1(8)=-141
    coorx1(9)=-141
    coorx1(10)=0
    coorx1(11)=141
    coory1(0)=-145.5
    coory1(1)=0
    coory1(2)=145.5
    coory1(3)=291
    coory1(4)=291
    coory1(5)=291
    coory1(6)=145.5
    coory1(7)=0
    coory1(8)=-145.5
    coory1(9)=-291
    coory1(10)=-291
    coory1(11)=-291
    Xmax=200
    Xmin=-200
    Ymax=350
    Ymin=-350
    Numcoor=4
    Numbarcoor=12


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 12:02 PM

All replies

  • Hi All,

    If there is no solution, maybe I will redraw the vectors by line line by find the intersection points of the zoom rectangle with each line line and each bar but at that case the mouse wheel will not work and will not be useful but before take that decision, I want to be sure that, I have not mistake in the above code (which taken 70% from Tommy code)

    https://social.msdn.microsoft.com/Forums/en-US/1d916047-e3d3-41da-8f1f-08957b5217ec/zoom-window-in-that-picture-box-by-mouse?forum=vbgeneral

    Kind Regards,

     


    Hany Metry

    Tuesday, November 19, 2019 7:02 PM
  • Hi All,

    If there is no solution, maybe I will redraw the vectors by line line by find the intersection points of the zoom rectangle with each line line and each bar but at that case the mouse wheel will not work and will not be useful but before take that decision, I want to be sure that, I have not mistake in the above code (which taken 70% from Tommy code)

    https://social.msdn.microsoft.com/Forums/en-US/1d916047-e3d3-41da-8f1f-08957b5217ec/zoom-window-in-that-picture-box-by-mouse?forum=vbgeneral

    Kind Regards,

     


    Hany Metry

    Hi All,

    The problem will not be solved even I draw the vectors line line because that code after modified by me from Mr. Tommy code does not draw the zoom red rectangle. 

    while the draw line line will enhance zoom area only.

    Can any one advice me?

    Kind Regards


    Hany Metry

    Wednesday, November 20, 2019 3:22 AM
  • Hi All,

    If there is no solution, maybe I will redraw the vectors by line line by find the intersection points of the zoom rectangle with each line line and each bar but at that case the mouse wheel will not work and will not be useful but before take that decision, I want to be sure that, I have not mistake in the above code (which taken 70% from Tommy code)

    https://social.msdn.microsoft.com/Forums/en-US/1d916047-e3d3-41da-8f1f-08957b5217ec/zoom-window-in-that-picture-box-by-mouse?forum=vbgeneral

    Kind Regards,

     


    Hany Metry

    Hi All,

    The shape fill 85% of size of picture box, so the user can't zoom more than (1/0.85),  so there is no way to zoom unless I find the intersection of zoom area with the shape line line and draw only part of the shape which inside the zoom area.

    That is lot of work but there is no way.

    Kind Regards


    Hany Metry


    • Marked as answer by Hany Metry Wednesday, November 20, 2019 6:09 AM
    • Edited by Hany Metry Wednesday, November 20, 2019 6:10 AM
    • Unmarked as answer by Hany Metry Wednesday, November 20, 2019 3:15 PM
    Wednesday, November 20, 2019 6:09 AM
  • Will youm please STOP marking any/all/several posts as ANBSWERED when they clearly do not answer the question.

    The protocol is: keep the thread open (by NOT marking ANSWER) until there is a valid and useful ANSWER. When such an answer is found, THEN close the thread by marking all the posts contributing towards the  ANSWER as ANSWER and/or VOTE + 1,  typically none of your own posts would qualify for a mark as ANSWER (there are exceptions, but few)

    Your habit seems to be to mark just about any post ass ANSWER! REMEMBER - once ANSWERED, a thread is typically closed.


    Regards Les, Livingston, Scotland

    Wednesday, November 20, 2019 2:38 PM
  • Hi All,

    If there is no solution, maybe I will redraw the vectors by line line by find the intersection points of the zoom rectangle with each line line and each bar but at that case the mouse wheel will not work and will not be useful but before take that decision, I want to be sure that, I have not mistake in the above code (which taken 70% from Tommy code)

    https://social.msdn.microsoft.com/Forums/en-US/1d916047-e3d3-41da-8f1f-08957b5217ec/zoom-window-in-that-picture-box-by-mouse?forum=vbgeneral

    Kind Regards,

     


    Hany Metry

    Hi All,

    The shape fill 85% of size of picture box, so the user can't zoom more than (1/0.85),  so there is no way to zoom unless I find the intersection of zoom area with the shape line line and draw only part of the shape which inside the zoom area.

    That is lot of work but there is no way.

    Kind Regards


    Hany Metry


    Hi All,

    If any one want to test the code above he should add the following code

    For I=0 to Numbarcoor-1

    Dia(I)=18

    Next

    Any how, I am working in the code as I described above (intersection line by line) and I will post it once it finished.

    Also the line code below

    Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width)

     need to be modified as below in two places.

    Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width/sf)

    kind Regards,


    Hany Metry

    Wednesday, November 20, 2019 6:09 PM
  • Hi All,

    I discovered my mistake to draw red rectangle for zoom.

    The I must replace the code below

    Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y) - CInt(ZoomMouseMovePt.Y))

    By the below one

    Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y))

    That I forget to modfy that code from Mr Tommy code after cancel Yoffset.

    But still the main problem of the question not solved because the graphics fill 85% of the picture box2 and I cant zoom, if any one have a debut, he may copy my code at empty form and to include all the modification in the subsequent posts. 

    so there is no way to zoom unless I find the intersection of zoom area with the shape line line and draw only part of the shape which inside the zoom area.

    I am currently preparing the code for that and i expect to finish it after two working days.

    I will work only few hours at Friday and few hours at Saturday and I expect to Finish it by end of Sunday (Cairo time). 

    Kind Regards,


    Hany Metry


    • Proposed as answer by tommytwotrain Thursday, November 21, 2019 11:23 AM
    • Unproposed as answer by Hany Metry Thursday, November 21, 2019 5:38 PM
    • Edited by Hany Metry Thursday, November 21, 2019 7:13 PM
    Thursday, November 21, 2019 6:21 AM
  • Hi All,

    I discovered my mistake to draw red rectangle for zoom.

    The I must replace the code below

    Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y) - CInt(ZoomMouseMovePt.Y))

    By the below one

    Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y))

    That I forget to modfy that code from Mr Tommy code after cancel Yoffset.

    Kind Regards,


    Hany Metry

    Hany,

    Ok good for you.

    See, you can do it, it just takes practice.

    When the answer has been posted then we mark the post or posts as the answer if the post contains the answer.

    If someone else has already posted the answer then you would mark their post as the answer. One can mark ones own post as the answer if the post is the answer and no one else has already answered.  If you have posted a second answer then you would mark both the first answer and your additional answer.

    It is also nice to mark questions that help you as helpful.

    If we dont mark any answers or helpful posts or say Thank You at least then folks will not be happy when we post our next question and future members will not find any useful answers from you.

    :)

    PS You can still mark the post as the answer if someone else has marked the post as proposed answer. Anyone can propose an answer but only the OP (original poster) can mark a post as THE ANSWER.

    So I marked your post as proposed answer and now if you agree you can mark your post as the answer to close the thread.


    • Proposed as answer by tommytwotrain Thursday, November 21, 2019 11:23 AM
    • Unproposed as answer by tommytwotrain Thursday, November 21, 2019 11:23 AM
    • Edited by tommytwotrain Thursday, November 21, 2019 11:29 AM
    Thursday, November 21, 2019 11:23 AM
  • Hi All,

    Below is the code to zoom window but still, it not work good 100% when the user do zoom inside zoom, that the drawing disappeared.

    Also when you wrongly click the mouse during mouse down (left click) or when you double click by mouse (left) during the mouse down, the program hang.

    The code is divided into two or three or four posts because it exceed 60'000 ch.

    Picture box2.client.width = 591 pix

    Picture box2.client.height = 486 pix

    there is checkbox1 to zoom out (back the drawing to its original size)

    There is a checkbox of name ZoomCb to start zoom

    Private ScaleWidth As Single = 591 Private ScaleRatio As Single = 1 Private Yoffset As Single Private Corner As New Point(0, 0) Private GridStep As Single = ScaleWidth / 5 Private MouseDownPt, MouseMovePt, ZoomMouseDownPt, ZoomMouseMovePt As PointF Private YQQ17 As Integer Private YQQ11 As Integer Private MouseStatus As Integer Private dx As Integer Private dy As Integer Private sf1 As Double Private ToolCbCancel As Boolean = False Private Soso As Integer = 1 Private Yint As Double Private Xint As Double Private Xint2 As Double Private Yint2 As Double Private Sub PictureBox2_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox2.Paint Dim G As Graphics = e.Graphics Dim q As Integer Dim vv As Integer Dim YY As Integer

    Xcoor(0)=200 Xcoor(1)=200 Xcoor(2)=-200 Xcoor(3)=-200 Ycoor(0)=-350 Ycoor(1)=350 Ycoor(2)=350 Ycoor(3)=-350 coorx1(0)=141 coorx1(1)=141 coorx1(2)=141 coorx1(3)=141 coorx1(4)=0 coorx1(5)=-141 coorx1(6)=-141 coorx1(7)=-141 coorx1(8)=-141 coorx1(9)=-141 coorx1(10)=0 coorx1(11)=141 coory1(0)=-145.5 coory1(1)=0 coory1(2)=145.5 coory1(3)=291 coory1(4)=291 coory1(5)=291 coory1(6)=145.5 coory1(7)=0 coory1(8)=-145.5 coory1(9)=-291 coory1(10)=-291 coory1(11)=-291 Xmax=200 Xmin=-200 Ymax=350 Ymin=-350 Numcoor=4 Numbarcoor=12

    For I =0 to Numbarcoor-1

    Dia(I)=18

    Next

    b = Xmax - Xmin

    t = Ymax - Ymin Dim sf As Single = CSng(PictureBox2.ClientSize.Width / (ScaleRatio * ScaleWidth)) e.Graphics.ScaleTransform(sf, sf) If ((MouseStatus = 3 Or MouseStatus = 1) And Soso <> 2) Or CheckBox1.Checked = True Then e.Graphics.TranslateTransform(-Corner.X, -Corner.Y) e.Graphics.Clear(Color.White) If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then For vv = 0 To Numcoor - 1 Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width / sf) Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) Next X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf)) X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf)) Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b)) YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf) YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf) Else For vv = 0 To Numcoor - 1 Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf)) Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) Next X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf)) Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t)) YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf) YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf) End If Dim points1(Numcoor - 1) As Point For vv = 0 To points1.Length - 1 points1(vv).X = CInt(Xcoor11(vv)) points1(vv).Y = CInt(Ycoor11(vv)) Next e.Graphics.DrawPolygon(mpen3, points1) e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a) e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a) Dim DrawFont9 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular) Dim DrawFont6 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular) e.Graphics.DrawString(Str3, DrawFont9, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf)) e.Graphics.DrawString(Str4, DrawFont9, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf)) Dim Str As String = CInt(b) & " x " & CInt(t) & " mm" Dim Brush As New SolidBrush(Color.Black) Dim textSize72 As SizeF textSize72 = G.MeasureString(Str, DrawFont9) XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize72.Width)) / 2) e.Graphics.DrawString(Str, DrawFont9, Brush, XQQ17, YQQ17) If NumBarcoor >= 1 Then If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then For YY = 0 To NumBarcoor - 1 Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b)) coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2 coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2 e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY))) e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf)) Next Else For YY = 0 To NumBarcoor - 1 Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t)) coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2 coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2 e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY))) e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf)) Next End If For q = 1 To NumBarcoor A(q) = pi * Dia(q - 1) ^ 2 / 4 Next q Ass1 = 0 For q = 1 To NumBarcoor Ass1 = Ass1 + A(q) Next Pr3 = Math.Round((Ass1 / Area1) * 100, 3) Pr = Pr3 Dim Str1 As String = Pr3 & "% reinf" Dim textSize19 As SizeF textSize19 = G.MeasureString(Str1, DrawFont9) XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2) e.Graphics.DrawString(Str1, DrawFont9, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf)) End If ElseIf MouseStatus = 0 And ZoomCb.Checked = True And CheckBox1.Checked = False Then e.Graphics.Clear(Color.White) If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then For vv = 0 To Numcoor - 1 Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width) * 0.075 + (((Xcoor11(vv) - ZoomMouseDownPt.X)) * (PictureBox2.ClientSize.Width * 0.85) / dx)) Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx)) Next X3a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X3a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx)) X4a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X4a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx)) Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx)) Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx)) Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx)) X5a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X5a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx)) sf1 = dx / (PictureBox2.ClientSize.Width * 0.85) Else For vv = 0 To Numcoor - 1 Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width) + ((-Convert.ToDouble(dx) / 2 + Xcoor11(vv) - ZoomMouseDownPt.X) / Convert.ToDouble(dy)) * 0.85 * (PictureBox2.ClientSize.Height)) Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy)) Next X3a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X3a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height) X4a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X4a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height) Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy)) Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy)) X5a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X5a - ZoomMouseDownPt.X) / dy) * (0.85 * PictureBox2.ClientSize.Height)) Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.Height) / Convert.ToDouble(dy)) sf1 = dy / (PictureBox2.ClientSize.Height * 0.85) End If Dim OO As Integer For I = 0 To Numcoor - 2 If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1))) ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1))) End If ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I))) End If ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1))) End If ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I))) End If ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) Else Xint = Xcoor11(I) End If If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1))) End If ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) Else Xint = Xcoor11(I) End If If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I))) End If ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) Else Xint = Xcoor11(I) End If If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1))) End If ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) Else Xint = Xcoor11(I) End If If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I))) End If ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I) Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height)) End If ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1) Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1) If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height)) End If

    I still need advice about my problems

    Kind Regards,


    Hany Metry

    Saturday, November 23, 2019 10:00 AM
  • Post 2 of the code above

    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                            Xint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                            Xint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                    End If
                    OO = I
                Next
                If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                        Xint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                        Xint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                End If
                If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    XQQ17 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ17 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                Else
                    XQQ17 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ17 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                End If
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Width) * 0.85 / Convert.ToSingle(dx))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width) * 0.075 + ((coorXf1(YY) - ZoomMouseDownPt.X) / Convert.ToDouble(dx)) * 0.85 * (PictureBox2.ClientSize.Width)) 
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx)) 
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Height) * 0.85 / Convert.ToSingle(dy))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width + ((-dx / 2 + coorXf1(YY) - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-dy / 2 + coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / (dy))
                        Next
                    End If
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        XQQ11 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ11 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Else
                        XQQ11 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ11 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    End If
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
            End If
            If MouseStatus = 1 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                If ZoomCb.Checked = True Then
                    'convert for positive yaxis and rectf
                    With e.Graphics
                        Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y))
                        .DrawRectangle(Pens.Red, rect)
                    End With
                Else
                    'draw other tracers if active
                End If
            End If
            'End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Form32Irregular_byCoordinates_Resize(0, Nothing)
            'PictureBox2.Invalidate()
            PictureBox2.Focus()
            MouseStatus = 3
            Soso = 1
        End Sub
        Private Sub Form32Irregular_byCoordinates_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            'Yoffset = Convert.ToSingle(ScaleWidth * (PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width))
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseDown
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                'keep zoom independant of drawing tools to allow nesting of zoom with tools.
                ZoomMouseDownPt = pt
                ZoomMouseMovePt = ZoomMouseDownPt
            End If
            MouseStatus = 1
            MouseMovePt = pt
            PictureBox2.Invalidate()
            PictureBox2.Focus()
        End Sub
        Private Sub Picturebox2_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseMove
            Dim pt As PointF = e.Location
            If MouseStatus = 1 Then
                If ZoomCb.Checked = True Then
                    ZoomMouseMovePt = pt
                    PictureBox2.Invalidate()
                End If
            End If
        End Sub
        Private Sub Picturebox2_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseUp
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                ZoomMouseMovePt = pt
                'ZoomCb.Checked = False
                'set scale based on zoom rect
                Select Case MouseStatus
                    Case 1
                        ZoomMouseMovePt = pt
                        'ZoomCb.Checked = False
                        'set scale based on zoom rect width
                        dx = CInt(ZoomMouseMovePt.X - ZoomMouseDownPt.X)
                        dy = CInt(ZoomMouseMovePt.Y - ZoomMouseDownPt.Y)
                        'ScaleWidth = dx
                        'set origin
                        'Corner.X = CInt(ZoomMouseDownPt.X)
                        'Corner.Y = CInt(ZoomMouseDownPt.Y)
                        'update yoffset etc
                        'PictureBox2.Invalidate()
                        Form32Irregular_byCoordinates_Resize(0, Nothing)
                End Select
            End If
            Soso = 2
            MouseStatus = 0
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter
            PictureBox2.Focus()
        End Sub
        Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
            If CheckBox1.Checked = True Then
                MouseStatus = 3
                Corner.X = 0
                Corner.Y = 0
                ScaleWidth = 591
                PictureBox2.Invalidate()
                CheckBox1.Checked = False
                ZoomCb.Checked = False
                Soso = 1
            End If
        End Sub


    Hany Metry


    • Edited by Hany Metry Saturday, November 23, 2019 10:19 AM edit the code
    Saturday, November 23, 2019 10:02 AM
  • Hi All,

    Also when you wrongly click the mouse during mouse down (left click) or when you double click by mouse (left) during the mouse down, the program hang.


    Hi All

    Same problem above (Hang the program during wrongly click or double click the mouse) is found in Mr/Tommy code in the previous thread.


    Hany Metry

    Saturday, November 23, 2019 10:11 AM
  • Hi All,

    Below is the code to zoom window but still, it not work good 100% when the user do zoom inside zoom, that the drawing disappeared.


    Hi All,

    The drawing disappeared because there is no code in case of mouse down to fix the drawing but I still need advice about that (even I will try to solve that problem but maybe tomorrow.


    Hany Metry



    • Edited by Hany Metry Saturday, November 23, 2019 11:14 AM The drawing disappeared because there is no code in case of mouse down to fix the drawing
    Saturday, November 23, 2019 10:22 AM
  • Hi All,

    Below is the code to zoom window but still, it not work good 100% when the user do zoom inside zoom, that the drawing disappeared.


    Hi All,

    The drawing disappeared because there is no code in case of mouse down to fix the drawing but I still need advice about that (even I will try to solve that problem but maybe tomorrow.


    Hany Metry



    Hi All,

    Below are the final answer code.

    The code is divided into two or three posts because it exceed 60'000 ch.

    Picture box2.client.width = 591 pix

    Picture box2.client.height = 486 pix

    there is checkbox1 to zoom out (back the drawing to its original size)

    There is a checkbox of name ZoomCb to start zoom.

    Public Class Form32Irregular_byCoordinates Private ScaleWidth As Single = 591 Private ScaleRatio As Single = 1 Private Yoffset As Single Private Corner As New Point(0, 0) Private GridStep As Single = ScaleWidth / 5 Private MouseDownPt, MouseMovePt, ZoomMouseDownPt, ZoomMouseMovePt As PointF Private YQQ17 As Integer Private YQQ11 As Integer Private MouseStatus As Integer Private dx As Integer Private dy As Integer Private sf1 As Double Private ToolCbCancel As Boolean = False Private Soso As Integer = 1 Private Titi As Integer = 1 Private Yint As Double Private Xint As Double Private Xint2 As Double Private Yint2 As Double Private Sub PictureBox2_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox2.Paint

    Xcoor(0)=200
    Xcoor(1)=200
    Xcoor(2)=-200
    Xcoor(3)=-200
    Ycoor(0)=-350
    Ycoor(1)=350
    Ycoor(2)=350
    Ycoor(3)=-350
    coorx1(0)=141
    coorx1(1)=141
    coorx1(2)=141
    coorx1(3)=141
    coorx1(4)=0
    coorx1(5)=-141
    coorx1(6)=-141
    coorx1(7)=-141
    coorx1(8)=-141
    coorx1(9)=-141
    coorx1(10)=0
    coorx1(11)=141
    coory1(0)=-145.5
    coory1(1)=0
    coory1(2)=145.5
    coory1(3)=291
    coory1(4)=291
    coory1(5)=291
    coory1(6)=145.5
    coory1(7)=0
    coory1(8)=-145.5
    coory1(9)=-291
    coory1(10)=-291
    coory1(11)=-291
    Xmax=200
    Xmin=-200
    Ymax=350
    Ymin=-350
    Numcoor=4
    Numbarcoor=12

    For I = 0 to Numbarcoor-1

    Dia(I)=18

    Next

    b = Xmax - Xmin
            t = Ymax - Ymin
            Dim sf As Single = CSng(PictureBox2.ClientSize.Width / (ScaleRatio * ScaleWidth))
            e.Graphics.ScaleTransform(sf, sf)
            If ((MouseStatus = 3 Or MouseStatus = 1) And Soso <> 2 And Titi <> 2) Or CheckBox1.Checked = True Then
                e.Graphics.TranslateTransform(-Corner.X, -Corner.Y)
                e.Graphics.Clear(Color.White)
                If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width / sf)
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf))
                    X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf))
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                End If
                Dim points1(Numcoor - 1) As Point
                For vv = 0 To points1.Length - 1
                    points1(vv).X = CInt(Xcoor11(vv))
                    points1(vv).Y = CInt(Ycoor11(vv))
                Next
                e.Graphics.DrawPolygon(mpen3, points1)
                e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                Dim DrawFont9 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular)
                Dim DrawFont6 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular)
                e.Graphics.DrawString(Str3, DrawFont9, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf))
                e.Graphics.DrawString(Str4, DrawFont9, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf))
                Dim Str As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush As New SolidBrush(Color.Black)
                Dim textSize72 As SizeF
                textSize72 = G.MeasureString(Str, DrawFont9)
                XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize72.Width)) / 2)
                e.Graphics.DrawString(Str, DrawFont9, Brush, XQQ17, YQQ17)
                If NumBarcoor >= 1 Then
                    If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    End If
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont9)
                    XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2)
                    e.Graphics.DrawString(Str1, DrawFont9, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf))
                End If
            ElseIf MouseStatus = 0 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                e.Graphics.Clear(Color.White)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width) * 0.075 + (((Xcoor11(vv) - ZoomMouseDownPt.X)) * (PictureBox2.ClientSize.Width * 0.85) / dx))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X3a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    X4a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X4a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    X5a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X5a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    sf1 = dx / (PictureBox2.ClientSize.Width * 0.85)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width) + ((-Convert.ToDouble(dx) / 2 + Xcoor11(vv) - ZoomMouseDownPt.X) / Convert.ToDouble(dy)) * 0.85 * (PictureBox2.ClientSize.Height))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X3a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X4a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X5a - ZoomMouseDownPt.X) / dy) * (0.85 * PictureBox2.ClientSize.Height))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.Height) / Convert.ToDouble(dy))
                    sf1 = dy / (PictureBox2.ClientSize.Height * 0.85)
                End If
                Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                   

    The completion of the code in the next post


    Hany Metry

    • Marked as answer by Hany Metry Sunday, November 24, 2019 11:31 AM
    • Unmarked as answer by Hany Metry Monday, November 25, 2019 8:47 AM
    Sunday, November 24, 2019 3:50 AM
  • Hi All,

    Code post 2

    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 20
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 21
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 22
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 23
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
    23:             ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
    22:             ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
    21:             ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
    20:             ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
    17:             ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                            Xint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
    18:             ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                            Xint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
    24:             ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
    25:             ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                    End If
                    OO = I
                Next
                If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
    123:        ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
    122:        ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
    121:        ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
    120:        ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
    117:        ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                        Xint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
    118:        ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                        Xint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
    124:        ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
    125:        ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                End If
                If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    XQQ17 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ17 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                Else
                    XQQ17 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ17 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                End If
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Width) * 0.85 / Convert.ToSingle(dx))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width) * 0.075 + ((coorXf1(YY) - ZoomMouseDownPt.X) / Convert.ToDouble(dx)) * 0.85 * (PictureBox2.ClientSize.Width))
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Height) * 0.85 / Convert.ToSingle(dy))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width + ((-dx / 2 + coorXf1(YY) - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-dy / 2 + coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / (dy))
                        Next
                    End If
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        XQQ11 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ11 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Else
                        XQQ11 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ11 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    End If
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
                Titi = 2



    Hany Metry


    • Edited by Hany Metry Sunday, November 24, 2019 11:30 AM Rev 1
    • Marked as answer by Hany Metry Sunday, November 24, 2019 11:31 AM
    • Unmarked as answer by Hany Metry Monday, November 25, 2019 8:47 AM
    Sunday, November 24, 2019 3:52 AM
  • Hi All,

    Code post 3



    Hany Metry


    Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 220
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 221
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 222
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 223
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
    223:            ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
    222:            ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
    221:            ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
    220:            ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
    217:            ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I + 1) - Xcoor11(I) <> 0 Then
                            Xint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                            Xint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
    218:            ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                        If Xcoor11(I) - Xcoor11(I + 1) <> 0 Then
                            Xint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                            Xint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Else
                            Xint = Xcoor11(I)
                            Xint2 = Xcoor11(I)
                        End If
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
    224:            ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
    225:            ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                    End If
                    OO = I
                Next
                If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2125
                    End If
    2123:       ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2124
                    End If
    2122:       ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2125
                    End If
    2121:       ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2125
                    End If
    2120:       ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 2118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 2124
                    End If
    2117:       ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(0) - Xcoor11(OO + 1) <> 0 Then
                        Xint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                        Xint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
    2118:       ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
                    If Xcoor11(OO + 1) - Xcoor11(0) <> 0 Then
                        Xint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                        Xint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Else
                        Xint = Xcoor11(OO + 1)
                        Xint2 = Xcoor11(OO + 1)
                    End If
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
    2124:       ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
    2125:       ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                End If
                If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
            End If
            If MouseStatus = 1 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                If ZoomCb.Checked = True Then
                    'convert for positive yaxis and rectf
                    With e.Graphics
                        Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), Math.Max(CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), 1), Math.Max(CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y), 1))
                        .DrawRectangle(Pens.Red, rect)
                    End With
                Else
                    'draw other tracers if active
                End If
            End If
            'End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Form32Irregular_byCoordinates_Resize(0, Nothing)
            'PictureBox2.Invalidate()
            PictureBox2.Focus()
            MouseStatus = 3
            Soso = 1
        End Sub
        Private Sub Form32Irregular_byCoordinates_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            'Yoffset = Convert.ToSingle(ScaleWidth * (PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width))
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseDown
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                'keep zoom independant of drawing tools to allow nesting of zoom with tools.
                ZoomMouseDownPt = pt
                ZoomMouseMovePt = ZoomMouseDownPt
            End If
            MouseStatus = 1
            MouseMovePt = pt
            PictureBox2.Invalidate()
            PictureBox2.Focus()
        End Sub
        Private Sub Picturebox2_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseMove
            Dim pt As PointF = e.Location
            If MouseStatus = 1 Then
                If ZoomCb.Checked = True Then
                    ZoomMouseMovePt = pt
                    PictureBox2.Invalidate()
                End If
            End If
        End Sub
        Private Sub Picturebox2_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseUp
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                ZoomMouseMovePt = pt
                'ZoomCb.Checked = False
                'set scale based on zoom rect
                Select Case MouseStatus
                    Case 1
                        ZoomMouseMovePt = pt
                        'ZoomCb.Checked = False
                        'set scale based on zoom rect width
                        dx = CInt(ZoomMouseMovePt.X - ZoomMouseDownPt.X)
                        dy = CInt(ZoomMouseMovePt.Y - ZoomMouseDownPt.Y)
                        If dx < 1 Then
                            dx = 1
                        End If
                        If dy < 1 Then
                            dy = 1
                        End If
                        'ScaleWidth = dx
                        'set origin
                        'Corner.X = CInt(ZoomMouseDownPt.X)
                        'Corner.Y = CInt(ZoomMouseDownPt.Y)
                        'update yoffset etc
                        'PictureBox2.Invalidate()
                        Form32Irregular_byCoordinates_Resize(0, Nothing)
                End Select
            End If
            Soso = 2
            Titi = 1
            MouseStatus = 0
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter
            PictureBox2.Focus()
        End Sub
        Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
            If CheckBox1.Checked = True Then
                MouseStatus = 3
                Corner.X = 0
                Corner.Y = 0
                ScaleWidth = 591
                PictureBox2.Invalidate()
                CheckBox1.Checked = False
                ZoomCb.Checked = False
                Soso = 1
                Titi = 1
            End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
            Me.Hide()
        End Sub
    End Class


    • Edited by Hany Metry Sunday, November 24, 2019 11:25 AM rev 1
    • Marked as answer by Hany Metry Sunday, November 24, 2019 11:31 AM
    • Unmarked as answer by Hany Metry Monday, November 25, 2019 8:46 AM
    Sunday, November 24, 2019 3:54 AM
  • Hi All,

    Sorry for the code which include variables  has no meaning like sf equal = 1.0 and that due many modification of the code from Mr/Tommy code.

    Also many variables are declared as double or integer while maybe single is enough and sorry for many transfer the variables to double or single and that has no meaning and that because some of the code is taken from other places in the same project and modified as appropriate for that place without modify the transfer to double or single ....

    Kind Regards, 


    Hany Metry

    Sunday, November 24, 2019 5:08 AM
  • Hi All,

    Some of the logic (if statements) which draw only the intersected lines within the zoom area still not correct and need some modification (need to add more condition if statements) that I was not checked for all cases. I am working for correction which take between one day to three days, but maybe I will not readjust the code posted.

    Kind Regards,



    Hany Metry

    • Marked as answer by Hany Metry Sunday, November 24, 2019 3:30 PM
    • Unmarked as answer by Hany Metry Sunday, November 24, 2019 8:01 PM
    Sunday, November 24, 2019 3:30 PM
  • Hi All,

    Some of the logic (if statements) which draw only the intersected lines within the zoom area still not correct and need some modification (need to add more condition if statements) that I was not checked for all cases. I am working for correction which take between one day to three days, but maybe I will not readjust the code posted.

    Kind Regards,



    Hany Metry



    Regards Les, Livingston, Scotland

    Sunday, November 24, 2019 3:38 PM
  • Hi All,

    Some of the logic (if statements) which draw only the intersected lines within the zoom area still not correct and need some modification (need to add more condition if statements) that I was not checked for all cases. I am working for correction which take between one day to three days, but maybe I will not readjust the code posted.

    Kind Regards,



    Hany Metry



    Regards Les, Livingston, Scotland


    I was want to make the person which read the answer know that there is minor error in the code and to highlight that note, I make it answer.

    Maybe I will edit the answer to be correct 100% after check every thing.


    Hany Metry


    • Edited by Hany Metry Sunday, November 24, 2019 8:25 PM
    Sunday, November 24, 2019 8:06 PM
  • Hi All,

    I use line intersection for zoom because the graphics is unknown and its drawn function of picture box dimension bounds, so if you zoom a line dimension = 90% of picture box width (0.90 W) then the line still of dimension 0.90 W and you can't draw part of line but if the dimension of line = 900 pixel and the dimension of width of picture box = 1000 then you can draw part of the line in the zoom and the remaining of the line will be out of picture box view.

    The problem is that dimension of lines = 0.90 picture box width or height and I cant transfer it to fixed pixel dimension because the shape not drawn by mouse. (shape is unknown before draw).

    Kind Regards,


    Hany Metry

    Monday, November 25, 2019 5:16 AM
  • Hi All,

    I will post the answer after 3-4 hours (at the end of Wednesday or at the end of Thursday)


    Hany Metry


    • Edited by Hany Metry Monday, November 25, 2019 11:45 AM
    Monday, November 25, 2019 8:51 AM
  • Hi All,

    I will post the answer after 3-4 days (at the end of Wednesday or at the end of Thursday)


    Hany Metry

    Hany,

    Why dont you show us a picture of what you mean?

    Otherwise nobody knows what you are talking about.

    Do you mean zoom after the user enters lines with coordinates? Cant you zoom 90 percent of ScaleWidth? You must know something about the size before the user draws?

    If you want to surround the size of what the user drew then cant you find max min of the line endpoints and that is scalewidth? I don't see why intersections of anything is required. Maybe it is?

    If you dont show pictures and completely explain what you mean then there is no point posting your code because no one can use it.

    The examples you post above do not even run and we don't have all the data. You are just wasting time you should just close the thread it is done.

    :)

    Monday, November 25, 2019 11:34 AM
  • Hi All,

    Below is the final answer after tested and checked.

    Picture box2.client.width = 591 pix

    Picture box2.client.height = 486 pix

    there is checkbox1 to zoom out (back the drawing to its original size)

    There is a checkbox of name ZoomCb to start zoom.

    Public Class Form32Irregular_byCoordinates
        Private ScaleWidth As Single = 591
        Private ScaleRatio As Single = 1
        Private Yoffset As Single
        Private Corner As New Point(0, 0)
        Private GridStep As Single = ScaleWidth / 5
        Private MouseDownPt, MouseMovePt, ZoomMouseDownPt, ZoomMouseMovePt As PointF
        Private YQQ17 As Integer
        Private YQQ11 As Integer
        Private MouseStatus As Integer
        Private dx As Integer
        Private dy As Integer
        Private sf1 As Double
        Private ToolCbCancel As Boolean = False
        Private Soso As Integer = 1
        Private Titi As Integer = 1
        Private Yint As Double
        Private Xint As Double
        Private Xint2 As Double
        Private Yint2 As Double
    Private Sub PictureBox2_Paint(sender As Object, e As PaintEventArgs) Handles PictureBox2.Paint
           
            Dim vv As Integer
            Dim YY As Integer
            b = Xmax - Xmin
            t = Ymax - Ymin
            Dim sf As Single = CSng(PictureBox2.ClientSize.Width / (ScaleRatio * ScaleWidth))
            e.Graphics.ScaleTransform(sf, sf)
            If ((MouseStatus = 3 Or MouseStatus = 1) And Soso <> 2 And Titi <> 2) Or CheckBox1.Checked = True Then
                e.Graphics.TranslateTransform(-Corner.X, -Corner.Y)
                e.Graphics.Clear(Color.White)
                If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(b)) * 0.85 * PictureBox2.ClientSize.Width / sf)
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) - 0.085 * (PictureBox2.ClientSize.Width / sf))
                    X4a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b) + 0.085 * (PictureBox2.ClientSize.Width / sf))
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b)))
                    X5a = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + Math.Abs(Xmin) * 0.85 * (PictureBox2.ClientSize.Width / sf) / Convert.ToDouble(b))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width / sf) + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + Xcoor(vv)) / Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - Ycoor(vv)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) - 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + 0.1 * Convert.ToDouble(b)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf)
                    Y3a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    Y4a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax + 0.1 * Convert.ToDouble(t)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin)) / Convert.ToDouble(t)) * (0.85 * PictureBox2.ClientSize.Height / sf))
                    Y5a = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax) * 0.85 * (PictureBox2.Height / sf) / Convert.ToDouble(t))
                    YQQ17 = CInt(0.87 * PictureBox2.ClientSize.Height / sf)
                    YQQ11 = CInt(0.92 * PictureBox2.ClientSize.Height / sf)
                End If
                Dim points1(Numcoor - 1) As Point
                For vv = 0 To points1.Length - 1
                    points1(vv).X = CInt(Xcoor11(vv))
                    points1(vv).Y = CInt(Ycoor11(vv))
                Next
                e.Graphics.DrawPolygon(mpen3, points1)
                e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                Dim DrawFont9 As New Font("Verdana", CInt(10 / sf), FontStyle.Regular)
                Dim DrawFont6 As New Font("Verdana", CInt(6 / sf), FontStyle.Regular)
                e.Graphics.DrawString(Str3, DrawFont9, Brush2, CInt(X4a + 5 / sf), CInt(Y5a - 8 / sf))
                e.Graphics.DrawString(Str4, DrawFont9, Brush2, CInt(X5a - 6 / sf), CInt(Y3a - 18 / sf))
                Dim Str As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush As New SolidBrush(Color.Black)
                Dim textSize72 As SizeF
                textSize72 = G.MeasureString(Str, DrawFont9)
                XQQ17 = CInt((PictureBox2.ClientSize.Width / sf - CInt(textSize72.Width)) / 2)
                e.Graphics.DrawString(Str, DrawFont9, Brush, XQQ17, YQQ17)
                If NumBarcoor >= 1 Then
                    If (Ymax - Ymin) / (Xmax - Xmin) <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Width / sf) * 0.85 / Convert.ToSingle(b))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width / sf) * 0.075 + ((Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(b)) * 0.85 * (PictureBox2.ClientSize.Width / sf)) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) / sf - Convert.ToDouble(t) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (2 * Convert.ToDouble(b)) + (Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Width / sf) / (Convert.ToDouble(b))) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Dia(YY) * (PictureBox2.ClientSize.Height / sf) * 0.85 / Convert.ToSingle(t))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width / sf + ((-Convert.ToDouble(b) / 2 + Math.Abs(Xmin) + coorx1(YY)) / Convert.ToDouble(t)) * 0.85 * PictureBox2.ClientSize.Height / sf) - Diaf1(YY) / 2
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height / sf) * 0.44 + (-Convert.ToDouble(t) / 2 + Ymax - coory1(YY)) * 0.85 * (PictureBox2.ClientSize.Height / sf) / Convert.ToDouble(t)) - Diaf1(YY) / 2
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont6, Brush, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf), CInt(coorYf1(YY) - 8 / sf))
                        Next
                    End If
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont9)
                    XQQ11 = CInt((PictureBox2.ClientSize.Width / sf - textSize19.Width) / 2)
                    e.Graphics.DrawString(Str1, DrawFont9, Brush, XQQ11, CInt(0.92 * PictureBox2.ClientSize.Height / sf))
                End If
            ElseIf MouseStatus = 0 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                e.Graphics.Clear(Color.White)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt((PictureBox2.ClientSize.Width) * 0.075 + (((Xcoor11(vv) - ZoomMouseDownPt.X)) * (PictureBox2.ClientSize.Width * 0.85) / dx))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Next
                    X3a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X3a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    X4a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X4a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    X5a = CInt((PictureBox2.ClientSize.Width) * 0.075 + (X5a - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    sf1 = dx / (PictureBox2.ClientSize.Width * 0.85)
                Else
                    For vv = 0 To Numcoor - 1
                        Xcoor11(vv) = CInt(0.5 * (PictureBox2.ClientSize.Width) + ((-Convert.ToDouble(dx) / 2 + Xcoor11(vv) - ZoomMouseDownPt.X) / Convert.ToDouble(dy)) * 0.85 * (PictureBox2.ClientSize.Height))
                        Ycoor11(vv) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Ycoor11(vv) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Next
                    X3a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X3a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    X4a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X4a - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    Y3a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y3a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    Y4a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y4a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    X5a = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + X5a - ZoomMouseDownPt.X) / dy) * (0.85 * PictureBox2.ClientSize.Height))
                    Y5a = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + Y5a - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.Height) / Convert.ToDouble(dy))
                    sf1 = dy / (PictureBox2.ClientSize.Height * 0.85)
                End If
                Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 32
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 34
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 33
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 35
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 32
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 34
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 33
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 35
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    34:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    35:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    32:                 Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    33:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 20
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 21
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 22
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 23
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
    23:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    22:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
    21:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 17
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 25
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    20:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 18
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 24
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    17:                 Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Xint2 = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 1000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    18:                 Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Xint2 = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    24:                 Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 1000
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    25:                 Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 1000
                    End If
    1000:           OO = I
                Next
               
            

    Post 1


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:02 PM
    Monday, November 25, 2019 11:54 AM
  • Post 2 of final code

    If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 134
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 135
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 134
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 135
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    134:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    135:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    132:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    133:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    123:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
    122:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    121:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 125
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
    120:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 124
                    End If
                    GoTo 2000
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    117:            Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Xint2 = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 2000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    118:            Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Xint2 = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    124:            Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 2000
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    125:            Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 2000
                End If
    2000:       If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                    XQQ17 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ17 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                Else
                    XQQ17 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ17 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                    YQQ17 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ17 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                End If
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Width) * 0.85 / Convert.ToSingle(dx))
                            coorXf1(YY) = CInt((PictureBox2.ClientSize.Width) * 0.075 + ((coorXf1(YY) - ZoomMouseDownPt.X) / Convert.ToDouble(dx)) * 0.85 * (PictureBox2.ClientSize.Width))
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height * 0.44) - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                        Next
                    Else
                        For YY = 0 To NumBarcoor - 1
                            Diaf1(YY) = Convert.ToInt32(Diaf1(YY) * (PictureBox2.ClientSize.Height) * 0.85 / Convert.ToSingle(dy))
                            coorXf1(YY) = CInt(0.5 * PictureBox2.ClientSize.Width + ((-dx / 2 + coorXf1(YY) - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                            coorYf1(YY) = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-dy / 2 + coorYf1(YY) - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / (dy))
                        Next
                    End If
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    For q = 1 To NumBarcoor
                        A(q) = pi * Dia(q - 1) ^ 2 / 4
                    Next q
                    Ass1 = 0
                    For q = 1 To NumBarcoor
                        Ass1 = Ass1 + A(q)
                    Next
                    Pr3 = Math.Round((Ass1 / Area1) * 100, 3)
                    Pr = Pr3
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If dy / dx <= Convert.ToDouble(PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width) Then
                        XQQ11 = CInt((PictureBox2.ClientSize.Width) * 0.075 + (XQQ11 - ZoomMouseDownPt.X) * 0.85 * (PictureBox2.ClientSize.Width) / Convert.ToDouble(dx))
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 - dy * 0.85 * (PictureBox2.ClientSize.Width) / (2 * dx) + (YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Width) / (dx))
                    Else
                        XQQ11 = CInt(0.5 * PictureBox2.ClientSize.Width + ((-Convert.ToDouble(dx) / 2 + XQQ11 - ZoomMouseDownPt.X) / dy) * 0.85 * PictureBox2.ClientSize.Height)
                        YQQ11 = CInt((PictureBox2.ClientSize.Height) * 0.44 + (-Convert.ToDouble(dy) / 2 + YQQ11 - ZoomMouseDownPt.Y) * 0.85 * (PictureBox2.ClientSize.Height) / Convert.ToDouble(dy))
                    End If
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
                Titi = 2
            ElseIf MouseStatus = 1 And Titi = 2 And ZoomCb.Checked = True Then
                Dim OO As Integer
                For I = 0 To Numcoor - 2
                    If Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(Xcoor11(I)), CInt(Ycoor11(I)), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 232
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 234
                        End If
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 233
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 235
                        End If
                    ElseIf Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 232
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 234
                        End If
                    ElseIf Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 233
                        ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 235
                        End If
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    234:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    235:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    232:                Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I + 1)), CInt(Ycoor11(I + 1)))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width Then
    233:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(I)), CInt(Ycoor11(I)))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 220
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 221
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                    ElseIf Xcoor11(I) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 222
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                    ElseIf Xcoor11(I + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                        Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 223
                        ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.015 * PictureBox2.ClientSize.Height Then
    223:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    222:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I) < 0.865 * PictureBox2.ClientSize.Height Then
    221:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 217
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 225
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(I) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    220:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                        ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                            GoTo 218
                        ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                            GoTo 224
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    217:                Xint = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        Xint2 = ((Xcoor11(I + 1) - Xcoor11(I)) / (Ycoor11(I + 1) - Ycoor11(I))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I)) + Xcoor11(I)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 3000
                    ElseIf Ycoor11(I + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(I + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(I) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(I) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    218:                Xint = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        Xint2 = ((Xcoor11(I) - Xcoor11(I + 1)) / (Ycoor11(I) - Ycoor11(I + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(I + 1)) + Xcoor11(I + 1)
                        If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                            e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    224:                Yint = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        Yint2 = ((Ycoor11(I) - Ycoor11(I + 1)) / (Xcoor11(I) - Xcoor11(I + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I + 1)) + Ycoor11(I + 1)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 3000
                    ElseIf Xcoor11(I + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(I) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(I + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(I) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(I) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    225:                Yint = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        Yint2 = ((Ycoor11(I + 1) - Ycoor11(I)) / (Xcoor11(I + 1) - Xcoor11(I))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(I)) + Ycoor11(I)
                        If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                            e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                        End If
                        GoTo 3000
                    End If
    3000:           OO = I
                Next
                

    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 11:58 AM
  • Post 3
    If Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen3, CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1134
                    End If
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1135
                    End If
                ElseIf Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1132
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1134
                    End If
                ElseIf Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    ElseIf Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1133
                    ElseIf Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1135
                    End If
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    1134:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    1135:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width Then
    1132:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(0)), CInt(Ycoor11(0)))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width Then
    1133:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height), CInt(Xcoor11(OO + 1)), CInt(Ycoor11(OO + 1)))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1120
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1121
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                ElseIf Xcoor11(OO + 1) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1122
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                ElseIf Xcoor11(0) >= 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.925 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
                    Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint >= 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1123
                    ElseIf Xint < 0.075 * PictureBox2.ClientSize.Width And Yint > 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.015 * PictureBox2.ClientSize.Height Then
    1123:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) <= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.015 * PictureBox2.ClientSize.Height Then
    1122:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint > 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(0) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) < 0.865 * PictureBox2.ClientSize.Height Then
    1121:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1117
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1125
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) <= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) > 0.075 * PictureBox2.ClientSize.Width And Ycoor11(OO + 1) >= 0.865 * PictureBox2.ClientSize.Height And Ycoor11(0) < 0.865 * PictureBox2.ClientSize.Height Then
    1120:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint), CInt(Xint), CInt(0.865 * PictureBox2.ClientSize.Height))
                    ElseIf Xint < 0.925 * PictureBox2.ClientSize.Width And Yint < 0.015 * PictureBox2.ClientSize.Height Then
                        GoTo 1118
                    ElseIf Xint > 0.925 * PictureBox2.ClientSize.Width And Yint < 0.865 * PictureBox2.ClientSize.Height Then
                        GoTo 1124
                    End If
                    GoTo 4000
                ElseIf Ycoor11(OO + 1) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    1117:           Xint = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    Xint2 = ((Xcoor11(0) - Xcoor11(OO + 1)) / (Ycoor11(0) - Ycoor11(OO + 1))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(OO + 1)) + Xcoor11(OO + 1)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 4000
                ElseIf Ycoor11(0) < 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) > 0.865 * PictureBox2.ClientSize.Height And ((Xcoor11(0) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(0) <= 0.925 * PictureBox2.ClientSize.Width) Or (Xcoor11(OO + 1) >= 0.075 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) <= 0.925 * PictureBox2.ClientSize.Width)) Then
    1118:           Xint = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.015 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    Xint2 = ((Xcoor11(OO + 1) - Xcoor11(0)) / (Ycoor11(OO + 1) - Ycoor11(0))) * (0.865 * PictureBox2.ClientSize.Height - Ycoor11(0)) + Xcoor11(0)
                    If Xint >= 0.075 * PictureBox2.ClientSize.Width And Xint <= 0.925 * PictureBox2.ClientSize.Width And Xint2 >= 0.075 * PictureBox2.ClientSize.Width And Xint2 <= 0.925 * PictureBox2.ClientSize.Width Then
                        e.Graphics.DrawLine(mpen3, CInt(Xint), CInt(0.015 * PictureBox2.ClientSize.Height), CInt(Xint2), CInt(0.865 * PictureBox2.ClientSize.Height))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(OO + 1) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(0) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    1124:           Yint = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    Yint2 = ((Ycoor11(OO + 1) - Ycoor11(0)) / (Xcoor11(OO + 1) - Xcoor11(0))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(0)) + Ycoor11(0)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 4000
                ElseIf Xcoor11(0) > 0.925 * PictureBox2.ClientSize.Width And Xcoor11(OO + 1) < 0.075 * PictureBox2.ClientSize.Width And ((Ycoor11(0) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(0) <= 0.865 * PictureBox2.ClientSize.Height) Or (Ycoor11(OO + 1) >= 0.015 * PictureBox2.ClientSize.Height And Ycoor11(OO + 1) <= 0.865 * PictureBox2.ClientSize.Height)) Then
    1125:           Yint = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.925 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    Yint2 = ((Ycoor11(0) - Ycoor11(OO + 1)) / (Xcoor11(0) - Xcoor11(OO + 1))) * (0.075 * PictureBox2.ClientSize.Width - Xcoor11(OO + 1)) + Ycoor11(OO + 1)
                    If Yint >= 0.015 * PictureBox2.ClientSize.Height And Yint <= 0.865 * PictureBox2.ClientSize.Height And Yint2 >= 0.015 * PictureBox2.ClientSize.Height And Yint2 <= 0.865 * PictureBox2.ClientSize.Height Then
                        e.Graphics.DrawLine(mpen3, CInt(0.075 * PictureBox2.ClientSize.Width), CInt(Yint2), CInt(0.925 * PictureBox2.ClientSize.Width), CInt(Yint))
                    End If
                    GoTo 4000
                End If
    4000:       If X3a >= 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, X4a, Y5a)
                ElseIf X3a >= 0.075 * PictureBox2.ClientSize.Width And X3a < 0.925 * PictureBox2.ClientSize.Width And X4a > 0.925 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X3a, Y5a, CInt(0.925 * PictureBox2.ClientSize.Width), Y5a)
                ElseIf X3a < 0.075 * PictureBox2.ClientSize.Width And X4a <= 0.925 * PictureBox2.ClientSize.Width And X4a > 0.075 * PictureBox2.ClientSize.Width And Y5a >= 0.015 * PictureBox2.ClientSize.Height And Y5a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, CInt(0.075 * PictureBox2.ClientSize.Width), Y5a, X4a, Y5a)
                End If
                If X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y3a < 0.015 * PictureBox2.ClientSize.Height And Y4a <= 0.865 * PictureBox2.ClientSize.Height And Y4a > 0.015 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, CInt(0.015 * PictureBox2.ClientSize.Height), X5a, Y4a)
                ElseIf X5a >= 0.075 * PictureBox2.ClientSize.Width And X5a <= 0.925 * PictureBox2.ClientSize.Width And Y4a > 0.865 * PictureBox2.ClientSize.Height And Y3a >= 0.015 * PictureBox2.ClientSize.Height And Y3a < 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawLine(mpen, X5a, Y3a, X5a, CInt(0.865 * PictureBox2.ClientSize.Height))
                End If
                Dim DrawFont99a As New Font("Verdana", 10, FontStyle.Regular)
                Dim DrawFont66 As New Font("Verdana", CInt(6), FontStyle.Regular)
                Dim textsizestr3 As SizeF
                Dim textsizestr4 As SizeF
                textsizestr3 = G.MeasureString(Str3, DrawFont99a)
                textsizestr4 = G.MeasureString(Str4, DrawFont99a)
                If CInt(X4a + 5 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X4a + 5 / sf1 + textsizestr3.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y5a - 8 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y5a - 8 / sf1 + textsizestr3.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str3, DrawFont99a, Brush2, CInt(X4a + 5 / sf1), CInt(Y5a - 8 / sf1))
                End If
                If CInt(X5a - 6 / sf1) >= 0.075 * PictureBox2.ClientSize.Width And CInt(X5a - 6 / sf1 + textsizestr4.Width) <= 0.925 * PictureBox2.ClientSize.Width And CInt(Y3a - 18 / sf1) >= 0.015 * PictureBox2.ClientSize.Height And CInt(Y3a - 18 / sf1 + textsizestr4.Height) <= 0.865 * PictureBox2.ClientSize.Height Then
                    e.Graphics.DrawString(Str4, DrawFont99a, Brush2, CInt(X5a - 6 / sf1), CInt(Y3a - 18 / sf1))
                End If
                Dim Str66 As String = CInt(b) & " x " & CInt(t) & " mm"
                Dim Brush66 As New SolidBrush(Color.Black)
                Dim textSize726 As SizeF
                textSize726 = G.MeasureString(Str66, DrawFont99a)
                If CInt(XQQ17) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ17 + textSize726.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ17 + textSize726.Height) <= CInt(0.87 * PictureBox2.ClientSize.Height + textSize726.Height) Then
                    e.Graphics.DrawString(Str66, DrawFont99a, Brush66, XQQ17, YQQ17)
                End If
                If NumBarcoor >= 1 Then
                    For YY = 0 To NumBarcoor - 1
                        If coorXf1(YY) >= 0.075 * PictureBox2.ClientSize.Width And coorXf1(YY) <= 0.925 * PictureBox2.ClientSize.Width - Diaf1(YY) And coorYf1(YY) >= 0.015 * PictureBox2.ClientSize.Height And coorYf1(YY) <= 0.865 * PictureBox2.ClientSize.Height - Diaf1(YY) Then
                            e.Graphics.FillEllipse(mbrush, CInt(coorXf1(YY)), CInt(coorYf1(YY)), CInt(Diaf1(YY)), CInt(Diaf1(YY)))
                            e.Graphics.DrawString(CStr(YY + 1), DrawFont66, Brush66, CInt(coorXf1(YY) + Diaf1(YY) + 1 / sf1), CInt(coorYf1(YY) - 8 / sf1))
                        End If
                    Next
                    Dim Str1 As String = Pr3 & "% reinf"
                    Dim textSize19 As SizeF
                    textSize19 = G.MeasureString(Str1, DrawFont99a)
                    If CInt(XQQ11) >= 0.001 * PictureBox2.ClientSize.Width And CInt(XQQ11 + textSize19.Width) <= 0.999 * PictureBox2.ClientSize.Width And CInt(YQQ11 + textSize19.Height) <= CInt(0.92 * PictureBox2.ClientSize.Height + textSize19.Height) Then
                        e.Graphics.DrawString(Str1, DrawFont99a, Brush66, XQQ11, YQQ11)
                    End If
                End If
            End If
            If MouseStatus = 1 And ZoomCb.Checked = True And CheckBox1.Checked = False Then
                If ZoomCb.Checked = True Then
                    'convert for positive yaxis and rectf
                    With e.Graphics
                        Dim rect As New Rectangle(CInt(ZoomMouseDownPt.X), CInt(ZoomMouseDownPt.Y), Math.Max(CInt(ZoomMouseMovePt.X) - CInt(ZoomMouseDownPt.X), 1), Math.Max(CInt(ZoomMouseMovePt.Y) - CInt(ZoomMouseDownPt.Y), 1))
                        .DrawRectangle(Pens.Red, rect)
                    End With
                Else
                    'draw other tracers if active
                End If
            End If
            'End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Form32Irregular_byCoordinates_Resize(0, Nothing)
            'PictureBox2.Invalidate()
            PictureBox2.Focus()
            MouseStatus = 3
            Soso = 1
        End Sub
        Private Sub Form32Irregular_byCoordinates_Resize(sender As Object, e As EventArgs) Handles Me.Resize
            'Yoffset = Convert.ToSingle(ScaleWidth * (PictureBox2.ClientSize.Height / PictureBox2.ClientSize.Width))
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseDown(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseDown
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                'keep zoom independant of drawing tools to allow nesting of zoom with tools.
                ZoomMouseDownPt = pt
                ZoomMouseMovePt = ZoomMouseDownPt
            End If
            MouseStatus = 1
            MouseMovePt = pt
            PictureBox2.Invalidate()
            PictureBox2.Focus()
        End Sub
        Private Sub Picturebox2_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseMove
            Dim pt As PointF = e.Location
            If MouseStatus = 1 Then
                If ZoomCb.Checked = True Then
                    ZoomMouseMovePt = pt
                    PictureBox2.Invalidate()
                End If
            End If
        End Sub
        Private Sub Picturebox2_MouseUp(sender As Object, e As MouseEventArgs) Handles PictureBox2.MouseUp
            Dim pt As PointF = (e.Location)
            If ZoomCb.Checked = True Then
                ZoomMouseMovePt = pt
                'ZoomCb.Checked = False
                'set scale based on zoom rect
                Select Case MouseStatus
                    Case 1
                        ZoomMouseMovePt = pt
                        'ZoomCb.Checked = False
                        'set scale based on zoom rect width
                        dx = CInt(ZoomMouseMovePt.X - ZoomMouseDownPt.X)
                        dy = CInt(ZoomMouseMovePt.Y - ZoomMouseDownPt.Y)
                        If dx < 1 Then
                            dx = 1
                        End If
                        If dy < 1 Then
                            dy = 1
                        End If
                        'ScaleWidth = dx
                        'set origin
                        'Corner.X = CInt(ZoomMouseDownPt.X)
                        'Corner.Y = CInt(ZoomMouseDownPt.Y)
                        'update yoffset etc
                        'PictureBox2.Invalidate()
                        Form32Irregular_byCoordinates_Resize(0, Nothing)
                End Select
            End If
            Soso = 2
            Titi = 1
            MouseStatus = 0
            PictureBox2.Invalidate()
        End Sub
        Private Sub Picturebox2_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox2.MouseEnter
            PictureBox2.Focus()
        End Sub
        Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
            If CheckBox1.Checked = True Then
                MouseStatus = 3
                Corner.X = 0
                Corner.Y = 0
                ScaleWidth = 591
                PictureBox2.Invalidate()
                CheckBox1.Checked = False
                ZoomCb.Checked = False
                Soso = 1
                Titi = 1
            End If
        End Sub
        Private Sub Form32Irregular_byCoordinates_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
            Me.Hide()
        End Sub
    End Class


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 12:00 PM
  • Post 4

    Below is the value of variables if any one want to test the code.

    Xcoor(0)=200
    Xcoor(1)=200
    Xcoor(2)=-200
    Xcoor(3)=-200
    Ycoor(0)=-350
    Ycoor(1)=350
    Ycoor(2)=350
    Ycoor(3)=-350
    coorx1(0)=141
    coorx1(1)=141
    coorx1(2)=141
    coorx1(3)=141
    coorx1(4)=0
    coorx1(5)=-141
    coorx1(6)=-141
    coorx1(7)=-141
    coorx1(8)=-141
    coorx1(9)=-141
    coorx1(10)=0
    coorx1(11)=141
    coory1(0)=-145.5
    coory1(1)=0
    coory1(2)=145.5
    coory1(3)=291
    coory1(4)=291
    coory1(5)=291
    coory1(6)=145.5
    coory1(7)=0
    coory1(8)=-145.5
    coory1(9)=-291
    coory1(10)=-291
    coory1(11)=-291
    Xmax=200
    Xmin=-200
    Ymax=350
    Ymin=-350
    Numcoor=4
    Numbarcoor=12


    Hany Metry

    • Marked as answer by Hany Metry Monday, November 25, 2019 12:03 PM
    Monday, November 25, 2019 12:02 PM
  • Hi All,

    I will post the answer after 3-4 days (at the end of Wednesday or at the end of Thursday)


    Hany Metry

    Hany,

    Why dont you show us a picture of what you mean?

    Otherwise nobody knows what you are talking about.

    Do you mean zoom after the user enters lines with coordinates? Cant you zoom 90 percent of ScaleWidth? You must know something about the size before the user draws?

    If you want to surround the size of what the user drew then cant you find max min of the line endpoints and that is scalewidth? I don't see why intersections of anything is required. Maybe it is?

    If you dont show pictures and completely explain what you mean then there is no point posting your code because no one can use it.

    The examples you post above do not even run and we don't have all the data. You are just wasting time you should just close the thread it is done.

    :)

    Hi Mr Tommy,

    1- The problem is that I want to draw the section with reinforcement of maximum size in the picture box to simplify the user, that maybe he don't need any zoom, so I make the drawing is function of width of picture box or height of picture box and that depend on the rectangularity of picture box and rectangularty of the section, so maybe the width of picture box will govern and at that case the section height will not fill all the picture box height while it will take only part of the height and maybe the height of picture box will govern and at that case the width of the section will not fill all the width of picture box.

    2- From the above all the dimension of every thing are function of picture box dimension.

    3- Also I want to use zoom area rectangularity.



    Hany Metry


    • Edited by Hany Metry Monday, November 25, 2019 12:32 PM
    Monday, November 25, 2019 12:16 PM
  • Hi All,

    I will post the answer after 3-4 days (at the end of Wednesday or at the end of Thursday)


    Hany Metry

    Hany,

    Why dont you show us a picture of what you mean?

    Otherwise nobody knows what you are talking about.

    Do you mean zoom after the user enters lines with coordinates? Cant you zoom 90 percent of ScaleWidth? You must know something about the size before the user draws?

    If you want to surround the size of what the user drew then cant you find max min of the line endpoints and that is scalewidth? I don't see why intersections of anything is required. Maybe it is?

    If you dont show pictures and completely explain what you mean then there is no point posting your code because no one can use it.

    The examples you post above do not even run and we don't have all the data. You are just wasting time you should just close the thread it is done.

    :)

    Hi Mr Tommy,

    I know that my way to zoom, maybe it is not the best way to zoom but I chose this way because maybe I have not enough patience to try to do your method of zoom especially when you write in the previous thread, that is final answer.

     


    Hany Metry

    Monday, November 25, 2019 1:53 PM