Tutoriales gratuitos para el aprendizaje de la programacion informatica! Recuerda que si lo puedes imaginar... lo puedes programar!

IMPRIMIR UNA IMAGEN DESDE UN PICTUREBOX EN VB.NET

1. Insertar objeto printdocument1
2. Doble click en el objeto printdocument1

Escribes el siguiente código:

E.GRAPHICS.DRAWIMAGE(PB1.IMAGE, 10, 20, 900, 920) 'PB1 ES EL NOMBRE DEL PICTUREBOX


3. Botón imprimir dentro de tu formulario doble clic y escribes este código:

If PRINTDIALOG1.SHOWDIALOG = WINDOWS.FORMS.DIALOGRESULT.OK Then
PRINTDOCUMENT1.PRINTERSETTINGS = PRINTDIALOG1.PRINTERSETTINGS
PRINTDOCUMENT1.PRINT()
End If


2 comentarios:

  1. Muchas gracias estimado ,solo que se tenía que agregar un PrintDialog también, muchas Gracias!!!!

    ResponderEliminar
  2. Excelente aporte , me has echo ganar mucho tiempo , agradecidisimo.

    ResponderEliminar