Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is my report zoomed? 2

Status
Not open for further replies.

farzad321

Programmer
Sep 14, 2019
53
FR

Hello expert friends ;
My application is running very well on all system , but in one system with windows 10 os , all preview and print is 150% zoomed.

It is clear that the problem is in this case. But all the outputs of other software such as Office can be seen normally. I deleted and reinstalled the printer driver but it made no difference

I am using vfp9 last version on windows 10. also i use the command SET REPORTBEHAVIOR 90.

In the printer settings, everything is set by default.

Do you have any ideas or tips for this problem?

WITH BEST REGARDS
 
Check System, Display setting of scaling to 150%. This effects VFP reports, too.

Chriss
 
I had exactly the same problem some time ago. On advice from this fourm, I placed the following code at the start of my main program:

Code:
DECLARE INTEGER SetProcessDPIAware IN WIN32API
SetProcessDPIAware()

This solved the problem.

Of course, you should try Chris's solution first. Or perhaps do both, on the basis that you won't always have control over the display settings on your users's systems.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I was very interested in this, thank you

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
I think FoxyPreviewer also solved the problem, but as far as I remember using SetProcessDPIAware also improves how fonts look on screen, no matter if you have the scale factor at 100% or not. There are notebooks and tablets with high DPI displays that make 150% the default and recommended display setting. VFP was always bad with anything diverting from the 100% norm and 96dpi for displays.



Chriss
 
You may consider looking at the DPIAwareManager class (at for a comprehensive approach to help VFP applications adapt to a display environment where the user changes the screen text scale.

Not all issues have been fully addressed (for instance, checkboxes and option buttons do not scale well over 200%). Still, our experience using it in production - including system responsiveness - has been globally positive, with minimal changes required.
 
A small rant about the dpi adaption process of applications not explicitly stating their dpi awareness: Microsoft, why do fonts look so bad with OS doing the scaling? I can understand why graphics can scale up blurry - resizing images to higher resolution means inventing new pixels, that's always a challenge at high-contrast borders and so they usually become blurry. But fonts are not bitmap graphics, they are areas bounded by bezier curves and scale up very well as - in short - they are vector graphics and it's a well-known property of vector graphics that they can be rednered in different sizes without changing their appearance. It seems to me Windows scales up text by scaling up the bitmap that resulted from font rendering instead of scaling up font sizes. So MS could have done and still could do this better.

Fazrad, now you know it search for SetProcessDPIAware here and you find a lot of threads already discussing it and the effect on reports, the discussions we already had bring up a few more details, for example see thread184-1808484.

Chriss
 

Thank you to all friends. First, I will read the help page of friends and after applying the suggestions, I will share the result. Again, I thank all Fox friends in particular Chris and Mike. I'm sorry for the delay in replying
 
Hi Antonio,

Do we have to use a form reference for dpi awareness for each form? Or is setting this for _screen OK for all?

Regards, Gerrit
 
I made a similar DPI/Scalable program and that one has to be called from within each form's Init event telling the form to scale all objects. If you don't, the existing form doesn't know that it should scale.
I guess Atlopes solution has the same requirement. But I don't know, I don't scale _screen.

I too had a hard time scaling checkboxes and option buttons. I chose automatically replacing the checkboxes with two labels, a square one (wingdings 252) and a text label. For option buttons I chose the graphical style, the easiest solution.

The messageboxes should also be replaced by an own one. Similar (or not) to the original. You don't want messages to be unreadable small.

Didn't touch reports. Never noticed strange report behaviour.
 
Gerrit
Gerrit said:
Do we have to use a form reference for dpi awareness for each form? Or is setting this for _screen OK for all?
That depends on your application framework.

Suppose you have a form manager that controls how forms are shown and activated. In that case, you can integrate the DPI-aware manager into the form manager and make the scaling process overall transparent. Otherwise, forms should invoke the DPI-aware management in their Init() event.

The DPI-Testing executable demonstrates a rudimentary form manager. The fundamental lines of code that correspond to the DPIAwareManager integration are these:
Code:
	* instantiate the form
	DO FORM ("forms\" + m.SCX[m.NumSCX, 1]) NAME m.ManagedForms[m.NumSCX + 1] LINKED NOSHOW

	* manage and show the form
	m.DPI.Manage(m.ManagedForms[m.NumSCX + 1])
	m.ManagedForms[m.NumSCX + 1].Show()
where [tt]m.ManagedForms[][/tt] is the array of forms the form manager manages.
 
JackTheC,

JackTheC said:
The messageboxes should also be replaced by an own one. Similar (or not) to the original. You don't want messages to be unreadable small.

The FoxyDialog is an excellent replacement for VFP "native" MessageBox and naturally follows the text scale setup that users define.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top