I am trying to write a program to print an image (jpg file) dirrectly to the default printer. Here is the code.
Imports System.DrawingImports System.Drawing.PrintingModule Module1 Sub Main() Dim printer As PrintDocument = New PrintDocument AddHandler printer.PrintPage, AddressOf PrintImage printer.Print() End Sub Private Sub PrintImage(ByVal sender As Object, ByVal e As PrintPageEventArgs) Dim img As Image = Image.FromFile("C:\...\MyImage.jpg") e.Graphics.DrawImage(img, 0, 0) End SubEnd Module
However, when I have a big image, resolution is very high (4000 x 6000 pixels). I would like to resize the image first before I print. Is there a way to resize the image? Could some one help me? Thanks