Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jeff_Van_Epps
Beginner
93 Views

What's the equivalent of "Maintain aspect ratio"?

How can I programmatically accomplish the effect of launching Intel GMA Driver control panel applet and selecting "Maintain aspect ratio" on Windows 7? Is there an API call to make, registry entry to change, configuration file to modify?
0 Kudos
4 Replies
Jeff_Van_Epps
Beginner
93 Views

I've tried a number of things, without success. The most promising was calling ChangeDisplaySettingsEx() with dmDisplayFixedOutput = DMDFO_CENTER, but that just returns error (-2 bad mode).
We have legacy kiosk software designed for 1024x768 and we're now moving to Windows 7 and to a 16x9 monitor. We don't want the desktop stretched - we want the aspect ratio maintained, understanding that we will have "black bars" on either side of the screen; that's to be addressed in a later release. It's fine if the image is scaled until it fills the screen vertically as long as it is scaled by the same amount horizontally, in fact that's preferable to just showing a 1024x768 image centered in the monitor with black bars on all 4 sides. That Intel GMA Driver checkbox for "Maintain aspect ratio" does exactly what we want (in conjunction with telling Windows the screen is 1024x768). The issue is how can our installer achieve this? We don't have the user interacting with Windows at any point - we can't have him start Control Panel and do this. Anyone have any thoughts?
SergeyKostrov
Valued Contributor II
93 Views

>>...The most promising was calling ChangeDisplaySettingsEx() with dmDisplayFixedOutput >>=DMDFO_CENTER, but that just returns error (-2 bad mode).

An error code -2 means 'The graphics mode is not supported'. Take a look at MSDN for more
information.

If you can do it with the Control Panel it could be done from an Installer, or any application.

Here are a couple of questions:

Did you try to call to 'EnumDisplaySettings' Win32 API function?

Did you try to update a driver for a '16x9' monitor?

Best regards,
Sergey
93 Views

thanks for sharing this information. i think it is useful informtion.






Milo Academy
Milo Adventist Academy
Milo Academy Horses

mbaupdates
Beginner
93 Views

2 problems with that:

1 - if the image is "wide" and the browser is "tall" then there's a bunch of white space beneath the image.

2 - if the image is taller than the browser window it cuts off the bottom of the image, instead of keeping it vertically centered on the page.

Thanks for the input, but I already talked about that method and it's problems in my original post.



Top MBA Colleges in India
Business School Ranking
Reply