×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Why is my report zoomed?
2

Why is my report zoomed?

Why is my report zoomed?

(OP)

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

RE: Why is my report zoomed?

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

Chriss

RE: Why is my report zoomed?

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

RE: Why is my report zoomed?

I was very interested in this, thank you

Regards

Griff
Keep Smileing

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

RE: Why is my report zoomed?

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

RE: Why is my report zoomed?

You may consider looking at the DPIAwareManager class (at https://github.com/atlopes/DPIAwareManager) 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.

RE: Why is my report zoomed?

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: Get application’s DPI Awareness.

Chriss

RE: Why is my report zoomed?

(OP)

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

RE: Why is my report zoomed?

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

RE: Why is my report zoomed?

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.

RE: Why is my report zoomed?

Gerrit

Quote (Gerrit)

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 --> VFP

* 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 m.ManagedForms[] is the array of forms the form manager manages.

RE: Why is my report zoomed?

JackTheC,

Quote (JackTheC)

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.

RE: Why is my report zoomed?

Quote:

forms should invoke the DPI-aware management in their Init() event.

And the best way of doing that is to do it in the Init of your base form class.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close