Problems with printing with the new "Direct 2D" APi

  1. last week

    Andreas A

    Sep 12 Pre-Release Testers, Xojo Pro

    With my program I print under Windows for years without problems. Since the change to the new "Direct 2D" APi my prints are scaled down to half. Also setting the p.MaxHorizontalResolution and p.MaxVerticalResolution does not change. Here is the code:

    Dim p As PrinterSetup
    p = New PrinterSetup
    p.MaxHorizontalResolution = 300
    p.MaxVerticalResolution = 300
    msgbox str(p.SetupString)

    After that the "ActualHorizontalResolution" has still 96.

    Thanks!

    Andreas

  2. Norman P

    Sep 12 Xojo Inc

    Many threads about this
    The 96 DPI is just how Windows direct 2D printing works

    https://forum.xojo.com/39870-printing-problem-with-xojo-2017-release-1-0
    https://forum.xojo.com/37144-printing-broken-on-windows-in-2016r4
    https://forum.xojo.com/42254-direct2d-windows-drawing
    https://forum.xojo.com/39893-horizontal-vertical-print-resolution-96-dpi/0
    https://forum.xojo.com/37090-png-quality-when-moving-to-2016r4-1/0

  3. Julian S

    Sep 12 Pre-Release Testers, Xojo Pro UK

    @Norman P The 96 DPI is just how Windows direct 2D printing works

    Uhhhhh huh

    // Set print control properties.
    D2D1_PRINT_CONTROL_PROPERTIES printControlProperties;
    printControlProperties.rasterDPI = 150.0f; // Use the default rasterization DPI for all unsupported Direct2D commands 

    https://msdn.microsoft.com/en-us/library/windows/desktop/hh973242(v=vs.85).aspx

  4. Norman P

    Sep 13 Xojo Inc

    Right

    // Use the default rasterization DPI for all unsupported Direct2D commands 

    for all UNSUPPORTED D2D commands
    D2D, unlike the old printing API, doesn't expose the device & its DPI settings directly to you
    Its a "virtual" 96 DPI much like PDF

  5. Andreas A

    Sep 14 Pre-Release Testers, Xojo Pro

    [quote=350040:@Julian S]Uhhhhh huh

    // Set print control properties.
    D2D1_PRINT_CONTROL_PROPERTIES printControlProperties;
    printControlProperties.rasterDPI = 150.0f; // Use the default rasterization DPI for all unsupported Direct2D commands 

    Thanks!

    But sorry, i do not understand it.

    What do I need to do with your code example? Where is it going?

    BR
    Andreas

  6. 6 days ago

    Julian S

    Sep 16 Pre-Release Testers, Xojo Pro UK

    You cant do anything with the code I posted, its related to the underlying framework. It was a response to the statement that Norman made about 96dpi being "how Windows direct 2D printing works", to which I'm not in agreement with.

    However, as I have neither the time, nor the interest in arguing the case, we'll just have to believe Xojo that this is the case, much like everyone was told "its just the way windows does it" regarding flicker problems on Windows.

    https://msdn.microsoft.com/en-us/library/windows/desktop/dd316887%28v=vs.85%29.aspx

    For the time being, if you are having issues with image quality, my only suggestion would be to increase the size of your image by 3x or 4x and scale it during your print (like the printing examples included with Xojo).

or Sign Up to reply!