1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
#Number six #Create pen $mypen = new-object Drawing.Pen red $mypen.width = 10 $form = New-Object Windows.Forms.Form $formGraphics = $form.createGraphics() #Drawing parallel lines #10, 10, 200, 10 #------------------------------- #10, 100, 200, 100 #------------------------------- #10, 200, 200, 200 #------------------------------- #Drawing perpendicular line #10, 10, 10, 100 #| #| #| #| #| | #| | #| | #| | #200, 100, 200, 200 #Create coordinates of points that define lines #Draw lines to screen (perpendicular and parallel) #Drawing parallel lines $form.add_paint({$formGraphics.DrawLine($mypen, 10, 10, 200, 10)}) $form.add_paint({$formGraphics.DrawLine($mypen, 10, 100, 200, 100)}) $form.add_paint({$formGraphics.DrawLine($mypen, 10, 200, 200, 200)}) #Drawing perpendicular lines $form.add_paint({$formGraphics.DrawLine($mypen, 10, 10, 10, 200)}) $form.add_paint({$formGraphics.DrawLine($mypen, 200, 100, 200, 200)}) $form.ShowDialog() |