在MFC C ++中管理屏幕分辨率 [英] Manage screen resolution in MFC C++

查看:254
本文介绍了在MFC C ++中管理屏幕分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在用MFC开发VC ++ 6.0中的游戏.我的屏幕分辨率为1280x1024像素,所以我有一个具有这种尺寸的背景位图.问题是当我将分辨率更改为较小时,看不到图片的某些部分.我正在使用BitBlt()函数显示位图.
我需要这样:
如果我的屏幕分辨率为1280x1024-图片分辨率为该尺寸
如果我的屏幕分辨率为1024x768-图片分辨率应为该尺寸
................................................... ........................

任何想法我能做什么?在此先谢谢您.

Hello, i''m developing a game in VC++ 6.0 with MFC. My screen resolution is 1280x1024 pixels, so i have a background bitmap with this size. The problem is when i change the resolution to be smaller, some parts of the pictures are not seen. I''m using BitBlt() function to display the bitmap.
I need to make it in that way:
If my screen resolution is 1280x1024 - the pic resolution to be that size
If my screen resolution is 1024x768 - the pic resolution to be that size
..........................................................................

Any ideas what i can do? Thanks in advance.

推荐答案

您可以使用StretchBlt()代替BitBlt(),尽管看起来可能不太好.使用SetStretchBltMode()可以更改像素从源到目标的映射方式.
You could use StretchBlt() instead of BitBlt(), though it might not look very good. Use SetStretchBltMode() to change how the pixels are mapped from the source to the destination.


您可以使用我的DLL(请参阅文章
You may use my DLL (see the article Plain C Resampling DLL) to resize the bitmap without loosing much quality (another option could be GDI+).
:)


这篇关于在MFC C ++中管理屏幕分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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