1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#Create pen $mypen = new-object Drawing.Pen red $mypen.width = 10 $form = New-Object Windows.Forms.Form $form.Width = 500 $form.Height = 550 $formGraphics = $form.createGraphics() #W $form.add_paint({$formGraphics.DrawLine($mypen, 0, 200, 100, 100)}) $form.add_paint({$formGraphics.DrawLine($mypen, 200, 200, 100, 100)}) $form.add_paint({$formGraphics.DrawLine($mypen, 0, 0, 0, 200)}) $form.add_paint({$formGraphics.DrawLine($mypen, 200, 0, 200, 200)}) $form.ShowDialog() |