1

I'm trying to print the form in visual studio when you press the P key but when its working but it keeps degrading the quality of the image/form and i don't know how to resize the form size in the printing.

this is the form i want to print

enter image description here

this is the degraded quality after i print the image

enter image description here

Private Sub IDPrint_KeyPress(sender As Object, e As KeyPressEventArgs) Handles MyBase.KeyPress

      If e.KeyChar = "p" OrElse e.KeyChar = "P" Then

        PrintDialog1.ShowDialog()

        PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings

        PrintForm1.Print()

      End If

    End Sub
braX
  • 11,506
  • 5
  • 20
  • 33
yeaboiya
  • 11
  • 1
  • If you're using a PDF printer, you should have a couple of settings: one to fit the Image in the Document bounds, one to set the quality (Format and Compression type) of the Image <- this one is always present in a PDF printer: yours is set to generate compressed JPEG images. You don't want that, use PNG instead. – Jimi Jul 18 '20 at 02:40
  • You can also try this ScrollableControl printer: [How to use PrintDocument with a scrollable Panel?](https://stackoverflow.com/a/57257205/7444103). It returns a Bitmap object that you an print or save to disk. – Jimi Jul 18 '20 at 02:41
  • Yes, right, this is [the VB.Net version](https://stackoverflow.com/a/57309095/7444103) of the above. – Jimi Jul 18 '20 at 02:44
  • Don't use that `PrintForm` component. Use a `PrintDocument` and then do your own GDI+ drawing in its `PrintPage` event handler and have control over exactly what gets printed. – jmcilhinney Jul 18 '20 at 03:19

1 Answers1

0

Power Pack Printform control is simply a bitmap copy of the screen. Since printers probably have a higher pixel resolution than monitors, the image you want to print will be stretched and appear fuzzy.

Considering Power Pack Printform is out of date and limited, I suggest you use the PrintDocument component to print from a Windows Form.

Here's the document you can refer to: How to: Print a Windows Form

Xingyu Zhao
  • 625
  • 7
  • 27