Page 1 of 1
SaveToMetaFile behaviour in Display scaling 125%
Posted: Sun Jan 03, 2016 4:04 pm
by 10551566
Hi,
If in Windows 10 I change the Display scaling to 125% (which is the default value) and use chart.SaveToMetaFile() the file is created with some extra space making the chart smaller. If I change the Windows 10 Display scaling to 100% the chart is saved correctly, see attachment for the two cases. How can I get the SaveToMetaFile with 125% scaling not to create that extra white space around the chart?
Thanks for any help or pointers.
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Mon Jan 04, 2016 12:51 pm
by yeray
Hello,
This issue sounds very similar to this:
http://www.teechart.net/support/viewtop ... =3&t=15815
If you still find problems with it don't hesitate to let us know arranging a simple example project we can run as-is to reproduce the problem here.
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Mon Jan 04, 2016 2:23 pm
by 10551566
I added a custom manifest as explained in the link you provided but it didn't change the behaviour of savetometafile. I have created a simple test application that shows the issue. Set the Display scaling to 100% and start the test app. When you click on the Save-button it will create a file chart.wmf, rename this file to something else, e.g. chart_100.wmf. Change the display scaling to 125% and then click on the save button again. When you now check chart.wmf you will see that the file has extra whitespace (at least that's what I'm experiencing, see also chart_100%.wmf and chart_125%.wmf).
Any idea what else I could try?
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Mon Jan 04, 2016 2:24 pm
by 10551566
I forgot to mention that I'm using Delphi 2009 and Teehchart 8.08.
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Tue Jan 05, 2016 10:47 am
by yeray
Hello,
Taking the manifest from the
Delphi Developers Guide 4K.pdf in the article
here and adding it to your project in RAD Studio 10 Seattle creates a .res that makes the application to also behave correctly in a 125% scale even when compiled in RAD XE.
Find the project with that .res, compiled with RAD XE and the results here:
However, I've tried to follow these guides (
1,
2) to generate a working .res from the same manifest above directly using RAD XE but I'm afraid I haven't succeeded. So I'm afraid I can't give you the exact instructions to achieve it, even if it seems it should be possible.
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Tue Jan 05, 2016 1:33 pm
by 10551566
Hi, thanks for your help. I found a component (at
http://issamsoft.com/en/Default.aspx) which allows you to edit the manifest file also under Delphi 2009. If I use the manifest below the charts are saved with the correct scaling. The only negative side-effect I noticed is that a TPanel I'm using in my main form is now dark gray instead of light gray (but it's a small issue)
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="*"/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Re: SaveToMetaFile behaviour in Display scaling 125%
Posted: Thu Jan 07, 2016 8:37 am
by yeray
Hi,
I'm glad to hear you found a way to make it work as you wish!