如何在从一个屏幕分辨率移动到另一个屏幕分辨率时修复主窗口的大小 [英] How to fix the size of a main window when moving from one screen resolution to another

查看:62
本文介绍了如何在从一个屏幕分辨率移动到另一个屏幕分辨率时修复主窗口的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个应用程序,我在主窗口上使用位图作为背景。它为程序提供了漂亮而专业的外观。然而,在屏幕分辨率增加的最新笔记本电脑上,主窗口变大了但不是位图。位图现在只能部分覆盖主窗口,外观既不漂亮也不专业。



有没有办法修复主窗口的大小以便它当从一个屏幕分辨率移动到另一个屏幕分辨率时,它还保持比例吗?



我使用Visual Studio C ++ 6.0。



提前谢谢!





maladuk

I have a couple of applications where I use a bitmap as background on the main window. It gives the programs a nice and professional appearance. However, on the latest lap-tops, where the screen resolution have been increased, the main windows becomes enlargened but not the bitmaps. The bitmaps now only partially cover the main window, and the appearance is neither nice nor professional.

Is there a way to fix the size of a main window so that it keeps its proportions also when moving from one screen resolution to another?

I use Visual Studio C++ 6.0.

Thank you in advance!


maladuk

推荐答案

A解决方法是调整位图大小/重新采样以适应增加的可用空间。具有良好的重新采样功能,您可以获得漂亮和专业的外观。请参阅我的文章:Plain C Resampling DLL [ ^ ]。
A workaround would be resizing/resampling the bitmap to fit on to the increased available space. With a good resampling function you may obtain a nice and professional look. See, for instance my article: "Plain C Resampling DLL"[^].


是的,你可以。您必须使用 SystemParametersInfo 当它发生变化时,您会收到消息 WM_SETTINGCHANGE 然后你可以调用自己的调整大小代码。您必须注册该msg并编写一个msg处理程序。
Yes you can. You must fetch and store the display resolution with SystemParametersInfo and when it changes you get the message WM_SETTINGCHANGE and then you can call your own resizing code. You must register for that msg and write a msg handler.


首先,考虑从VC6升级到VS工具的当前社区版。



其次,试试这个...



http://msdn.microsoft.com/en-us/library/windows/desktop/dd145121%28v=vs.85%29.aspx [ ^ ]



...将像素拉伸到画布区域。
First, consider upgrading from VC6 to a current community edition of the VS tools.

Second, try this ...

http://msdn.microsoft.com/en-us/library/windows/desktop/dd145121%28v=vs.85%29.aspx[^]

... to stretch the pixels onto canvas area.


这篇关于如何在从一个屏幕分辨率移动到另一个屏幕分辨率时修复主窗口的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆