PNG Quality when moving to 2016r4.1

I know I am behind the curve on this issue but after doing a review of all conversations(?) I cannot find a fix.

I use a canvas to display .png files ( sometimes .jpg) that are loaded from a file, scaled to fit the canvas size and presented to the user in a window. This is an internal tool for my company engineering dept. and it is only necessary to re-build with newer versions of Xojo if an update is required or problems arise.

I am working on a revision and loaded the Windows App to begin the enhancement in 2016r4.1. The canvas presentation of the graphics file, that worked great on 2016r3 now looks as if it were scaled up from a thumbnail and is so poor it cannot be used. The same results occur when printing that file.

I use g.drawpicture for all output, screen or printer. I did use GDI+ but noticed it has been deprecated.

I have done nothing to account for HiDPI or Direct2D

This App is only used on Windows and has not been tested on OSX. Can anyone point me in the right direction?

Can you show us a screenshot with the difference? Do you have hiDPI enabled? And as usual “show us the codez”. What are you doing?

You should really try to use Scale factor. HiDPI can really change the result for the better. In particular on scaled displays.

When does the scaling occur?

dont change the picture… just draw it in the canvas paint event. Does the same happen?

Dropbox link to two screenshot images (.png)

My code is as simple as it gets

   [b]     g.drawpicture (p,offsetx,offsety,xscaled,yscaled,0,0,p.width,p.height)[/b]

g is related to the canvas to be drawn on
p is the picture that is loaded from a file. This file is a standard .png file created by another application.
xscaled & yscaled are used to maintain aspect ratio and are calculated elsewhere.
offsetx & offsety are also calculated elsewhere and are normally zero

And which screenshot is the better one? I can’t see a difference. Are the xscaled and yscaled values the same?

Image 1 is better… 2 has less black.
But 2016R4 seems to be getting a lot of noise about graphics quality.

Just out of curiosity… do matters improve if you add or reduce the size by a pixel or two?
Maybe there is an issue about word boundaries, or ‘which pixel we drop’ when reducing the size.
If you dont resize, do you keep the quality?

When build is done from Xojo 2016R3 or earlier the graphic presentation is much better. Note the text presentation and clarity in the ‘Screenshot 2016-12-14 Xojo 2016r3.png’ [which is the first image in the folder]

The screenshot does not effectively show the quality since it is impacted by it being a screenshot. Since I use the same Method for printed output whether it is to the screen or printer my printed output is also significantly impacted.

Previous to using Xojo 2016r4.1 the printed output from the .png file was as good as when originally printed from the original application, now . . . not so good. So bad that it is not usable.

The .png File resolution 300 dpi, generally 2550 pixels x 3300 pixels or sized at 300 dpi for an 8 1/2" x 11" sheet

Hello,
I am experiencing something similar, when printing vector graphics drawn in Xojo under Windows 7. See Feedback case 46218. <https://xojo.com/issue/46218>

Its more than likely scaled and always has been on screen

Printing is a known issue and its being worked on AFAIK

I think you may want to consider some computer glasses :slight_smile:

Dropbox showing the images at not 100% got me confused. At 70% the images look more or less the same.

Don’t let Xojo do the scaling of your images. Even for simple screenshots I was able to get an improvement with bilinear interpolation. I think I posted the code here on the forum.

[quote=303408:@Christian Mézes]Hello,
I am experiencing something similar, when printing vector graphics drawn in Xojo under Windows 7. See Feedback case 46218. <https://xojo.com/issue/46218>[/quote]

Thanks Christian. I do not have a fix but it is at least helpful in knowing it isn’t necessarily something to spend development time on.

[quote=303453:@Norman Palardy]Its more than likely scaled and always has been on screen

Printing is a known issue and its being worked on AFAIK[/quote]

Thanks Norman. Yes the screen printing into the Canvas is scaled down but had resulted in good quality in previous revisions. When reviewing the .png file directly I see good quality, but that is when utilizing an application specifically for reviewing graphics files. In doing this I do not know if that application is performing any adjustment to the output.

I will wait for further information before chasing the problem on my end.