Problems with EMF files on Surface Pro

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Problems with EMF files on Surface Pro

Post by Data Innovations » Wed Nov 09, 2016 1:25 pm

We have a program that has worked flawlessly for 10 years through Windows XP, 7, 8, and 10. But now when we run it on a Surface Pro under Win 10, the graphs are only visible in 1/4 of the space that they were previously. It is as if the EMF is prepared with the correct "canvas" size, but the chart itself is only created in 1/4 of the space (1/2 of each of the dimensions).

We found some examples on the web that use Chart.Export, but Export is not known in our release of the TeeChart software (7.12).

Any thoughts/help would be appreciated

Marc
Site Admin
Site Admin
Posts: 1271
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Problems with EMF files on Surface Pro

Post by Marc » Thu Nov 10, 2016 1:15 pm

Hello,

We don't have instant access to a Surface to try this out but can setup a test sometime over the next few days. In the meantime, if your program can recognise machine/sysop type, would it be possible increase the size of the image proportionally as a temporary workaround?

Regards,
Marc Meumann
Steema Support

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Thu Nov 10, 2016 2:29 pm

Hello,

Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Fri Nov 11, 2016 2:40 am

Your request is reasonable. I will try to get to this in the next few days.

Jon

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Fri Nov 11, 2016 11:18 am

Hello,

In addition to the simple example project, we'd appreciate if we could get some extra information such as:
- What Surface Pro are you running?
- What Windows 10 build are you running?
- Have you tried to generate the emf files in a different machine and open the emf file in your Surface Pro?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Fri Nov 11, 2016 8:25 pm

I have attached a ZIP file containing the following:

1) SurfaceProTestDelphi.ZIP: this contains the source code for the test program

2) Two PNG files, showing screen shots on both my Development VM (Dev VM, Win 7) and the Surface Pro 3 (Win 10). The left part of each screen shot shows the running test program, while the right part shows how Paint sees the EMF. Note the extra white space on the Surface Pro

3) Two EMF files, the two EMF files which were generated (one under Win 7 and one under Win 10 on the Surface Pro).

The Surface Pro is a Surface Pro 3 running Windows 10 Pro 64 with dual 1.9 GHz processor and 4 GB of RAM. It is fully updated.

Let me know how else I can help you understand the bug.

Jon
Attachments
SurfaceProBug.zip
(214.11 KiB) Downloaded 613 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Mon Nov 14, 2016 10:49 am

Hello Jon,

Your test application generates a correct .emf for me here in a Windows 10 machine.
However, if I open the "SurfaceProTest on Surface Pro.EMF" file in Paint I see it has a wrong height and width, as in your "Surface Pro Test on Surface Pro.png" screenshot.
So it looks as if the Surface Pro 3 was taking a wrong TRect from the "function TCustomTeePanel.GetRectangle:TRect;". But it's hard to say without reproducing (and debug) the problem here.
You could try forcing a repaint before creating the .emf to see if it makes any difference.

Code: Select all

procedure TForm1.FormShow(Sender: TObject);
//...
    Draw;
    SaveToMetaFileEnh(fName);
    RunAppByDocument(fName);
    end;
  end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Mon Nov 14, 2016 2:57 pm

Adding the Draw does not change the behavior of the program on the SurfacePro

Jon

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Tue Nov 15, 2016 1:23 pm

Hello Jon,

I'm afraid we couldn't get a Surface Pro 3. And it's difficult to see what's exactly happening without a device where the problem can be reproduced.
Can I ask you to add this code to check what rectangle is the Surface using?

Code: Select all

  with Chart1 do begin
  //...
    Title.Caption:='GetRectangle: '+
                    IntToStr(GetRectangle.Right-GetRectangle.Left)+'x'+
                    IntToStr(GetRectangle.Bottom-GetRectangle.Top);
I guess it will give 590x651 while it gives 393x433 on the desktop. This is a ratio of x1.5

You could also try GetClientRect instead of GetRectangle, to see it if gives the same result:

Code: Select all

  with Chart1 do begin
  //...
    Title.Caption:='GetClientRect: '+
                    IntToStr(GetClientRect.Right-GetClientRect.Left)+'x'+
                    IntToStr(GetClientRect.Bottom-GetClientRect.Top);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Tue Nov 15, 2016 8:37 pm

Here are the results for Win 7 and for the Surface Pro Win 10
Attachments
Surface Pro Program on Win 7.PNG
Surface Pro Program on Win 7.PNG (50.33 KiB) Viewed 18978 times
Surface Pro Program on  Surface Pro.png
Surface Pro Program on Surface Pro.png (103.88 KiB) Viewed 18978 times

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Wed Nov 16, 2016 2:30 am

We have borrowed a Surface Pro to use for testing. We will have to return it at the end of the day on Friday. So, after that, I will be unable to respond to requests for changes in the test software.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Wed Nov 16, 2016 9:31 am

Hello,

I'm sorry, I'm afraid the code I suggested for GetClientRect is retrieving the TRect of the form, not of the TChart. Please use this instead:

Code: Select all

type TWinControlAccess=class(TWinControl);
//...
    Title.Caption:='GetRectangle: '+
                    IntToStr(GetRectangle.Right-GetRectangle.Left)+'x'+
                    IntToStr(GetRectangle.Bottom-GetRectangle.Top);

    Title.Caption:=Title.Caption+'; GetClientRect: '+
                    IntToStr(TWinControlAccess(Chart1).GetClientRect.Right-TWinControlAccess(Chart1).GetClientRect.Left)+'x'+
                    IntToStr(TWinControlAccess(Chart1).GetClientRect.Bottom-TWinControlAccess(Chart1).GetClientRect.Top);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Wed Nov 16, 2016 1:12 pm

This is the Surface Pro result using the new source code you provided.
Attachments
Surface Pro Test on Surface Pro.png
Surface Pro Test on Surface Pro.png (101.01 KiB) Viewed 18979 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problems with EMF files on Surface Pro

Post by Yeray » Thu Nov 17, 2016 12:35 pm

Hello,

These results make me think again there must be some scaling issue. And I see some changes are giving problems to some devices:
https://blogs.technet.microsoft.com/ask ... ary-update

Could you please tell us what exact Windows 10 build is the Surface Pro 3 using?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Data Innovations
Newbie
Newbie
Posts: 10
Joined: Wed Jun 08, 2016 12:00 am

Re: Problems with EMF files on Surface Pro

Post by Data Innovations » Thu Nov 17, 2016 12:49 pm

Version 1607 Build 14393.0, but we first saw this on another Surface Pro from China, so I doubt that the exact OS build is important in reproducing this bug.

Post Reply