• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Dibujar una recta en una imagen dentro de un formulario de PowerShell

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Crear en Pen
$mypen = new-object Drawing.Pen red
$mypen.width = 5
 
# Crear el formulario
$form = New-Object Windows.Forms.Form
$form.Width = 580
$form.Height = 235
$formGraphics = $form.createGraphics()
 
# Añadir una imagen al formulario
$Image = [system.drawing.image]::FromFile("C:\Users\Desktop\bank.jpg")
$Form.BackgroundImage = $Image
 
# Dibujar una línea en la imagen del formulario
$form.add_paint({$formGraphics.DrawLine($mypen, 550, 170, 420, 185)})
 
$form.ShowDialog()

Publicado el día 28 de noviembre de 2019

CATEGORÍAS

Gráficos, PowerShell

ETIQUETAS

add_paint, createGraphics, Drawing, Drawing.Pen, DrawLine, Jesús Niño, Jesús Niño Camazón, New-Object, showdialog, System.Drawing, Windows, Windows.Forms.Form

MÁS

  • Crear un formulario en PowerShell
  • Técnico Superior en Desarrollo de Aplicaciones Web
  • Buscar el nombre de una clase de un formulario en PowerShell con Microsoft Spy++ y escribir un mensaje en una caja de texto sin conocer el identificador de ventana en concreto del proceso…
  • Ejercicios de PowerShell: crear mediante scripts una estructura de una red con un dominio y las configuraciones de GPOS que necesites
  • Crear formulario dentro de otro formulario mediante una función con PowerShell
  • Ejercicios de PowerShell: realizar operaciones en un equipo remoto