Drawinto Quality Poor

I am making reports and I am seeing very poor quality using a container that is embedded in a window that is using drawinto. I am then using g.drawpicture to create the image which looks bad.

I am doing it this way since I love the look of the listbox on this container the way I have it trimmed out. It looks very professional. I hope that this isn’t the best Drawinto can give us surely?

[code]
DeviceProfileReportPrintContainer = New DeviceProfileReportContainer
Dim deviceProfilePicture as New Picture(DeviceProfileReportPrintContainer.Width,DeviceProfileReportPrintContainer.Height)

  Dim fakeWindow as New Window
  DeviceProfileReportPrintContainer.Embedwithin(fakeWindow)
  DeviceProfileReportPrintContainer.DrawInto(deviceProfilePicture.Graphics,0,0)
  g.DrawPicture(deviceProfilePicture,leftMargin,150)
  [/code]

PDF Output

  • Note that the logo and titlestring are g.drawstring/g.drawpicture

https://www.dropbox.com/s/dx0mfkc5wne6wn0/TestReport.pdf?dl=0

Thanks in advance!!

Mike - I’ve seen this as well. I was drawing content onto a canvas and then using DrawInto to put that into a picture. I did not like the results. So I went the other way - drew to the picture and then drew the picture on the canvas. Helped with other things too like pagination. I create a separate picture object for each page. So it was better in the end.

But I concur that the quality seems really poor. Fine for onscreen but bad if you want it in a report.

Thanks Jon! I can’t get drawinto to drawinto the picture without embedding the container somewhere first… But it doesn’t matter as you have seen the same quality issues. Thanks again.

Something that might be part of the problem… Remember you screen (depending) is only about 96DPI, your printer is 300, 600 or better DPI… so if the print has to actually stretch you picture when it prints it… then the quality will be less

What platform?

OS X 10.10.1 MBP 15" Retina

Dave great point. Let me validate that I properly drawing the DPI I am expecting.

Thank you.

Anything more than 96 DPI then the image printed is way too small. I did confirm @ 96DPI that my sizing of the picture being drawinto is correct, but the quality is just not that good unfortunately.

Joe should I open a feedback case?

Might be this one?

(https://xojo.com/issue/23239)>]<https://xojo.com/issue/23239>

Not many printers print at 96DPI… so exactly what did you do?

Most printers if you set an unsupported resolution, will switch to the closest one… meaning 96DPI would most likely go to 72DPI (default)… and there really isn’t any standard printer resolution that is a multple of 96

what does it look like if you set the printer to 72 DPI, but print the picture 3x size ( 4x72=288 3x96=288 )

The solution if you want to use Drawinto with the printer is to use a much larger control on a different window, then drawinto that in the printer g object.

[quote=149353:@Dave S]Not many printers print at 96DPI… so exactly what did you do?

Most printers if you set an unsupported resolution, will switch to the closest one… meaning 96DPI would most likely go to 72DPI (default)… and there really isn’t any standard printer resolution that is a multple of 96

what does it look like if you set the printer to 72 DPI, but print the picture 3x size ( 4x72=288 3x96=288 )[/quote]

Dim ps as New PrinterSetup
If ps.PageSetupDialog Then
ps.MaxHorizontalResolution= 96 //
ps.MaxVerticalResolution= 96 //
g = OpenPrinterDialog(ps)

PageHeight = ps.PageHeight
PageWidth = ps.PageWidth
leftMargin = Abs(ps.PageLeft)
horizontalMarginGap = leftMargin
rightMarginStartLeft = ps.Width-(leftMargin+1)
topMargin = Abs(ps.PageTop)

Michel thanks for the response and this fixes the quality issue (using a larder control)?

Mike… add this one line as a test

  Dim ps as New PrinterSetup
  If ps.PageSetupDialog Then
    ps.MaxHorizontalResolution= 96 //
    ps.MaxVerticalResolution= 96 //
    msgbox str(ps.HorizontalResolution)+"x"+str(ps.VerticalResolution) // output is 72x72
  end if

The answer will be 72x72

You can ONLY set MAX to values that are supported by your printer, otherwise it will round them down

[quote=149473:@Dave S]Mike… add this one line as a test

  Dim ps as New PrinterSetup
  If ps.PageSetupDialog Then
    ps.MaxHorizontalResolution= 96 //
    ps.MaxVerticalResolution= 96 //
    msgbox str(ps.HorizontalResolution)+"x"+str(ps.VerticalResolution) // output is 72x72
  end if

The answer will be 72x72

You can ONLY set MAX to values that are supported by your printer, otherwise it will round them down[/quote]

Yes Dave you are 100% Correct. 72x72 no matter I set 96x96.

I discovered this when working on SnapDragon… since it had to scale things properly between the screen and paper… I found it best to set MAXHorizontal to some “big value” and use Horizontal as that was what the printer actually was.

That is a heck of a tip thanks Dave! I will try that and do some research on a few printers :slight_smile: I have an HP Arch C Plotter and a normal inkjet.

Thanks for pointing that out!

I have a dot matrix if you need to test it on that?

Ha nice! Good to see your technology is top notch in Surrey! :slight_smile: