缩放按钮中的图像 [英] Zooming image in a button

查看:83
本文介绍了缩放按钮中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在开发MFC/C ++应用程序.我有一些按钮,每个人都包含一个位图.我希望将鼠标光标放在按钮上时,可以显示较大尺寸的图像,例如图像的缩放比例.
任何人都可以知道该怎么做吗?
非常感谢您的宝贵帮助.
最好的问候.

Hello everyone,
I''m developping an MFC/C++ application. I''ve some buttons witch everyone contain a bitmap. I want that when I put the mouse cursor on a button, I display the image with a larger dimensions such as a zoom of the image.
Can anyone have an idea how to do ?
Many thanks for your precious help.
Best regards.

推荐答案

您的按钮必须能够检测鼠标何时在其矩形内.我想我记得它被称为鼠标捕获"之类的东西.自从我开始使用C ++/MFC已有三年多了.

一旦按钮检测到鼠标已进入其矩形,就可以使按钮调整图像的大小.
Your button has to be able to detect when the mouse is within it''s rectangle. I think I remember it being call mouse capture or something like that. It''s been more than three years since I did any C++/MFC.

Once the button detects that the mouse has entered its rectangle, you can have the button resize the image.


也许可以将StretchBlt()图像放大到更大的矩形. http://msdn.microsoft.com/en-us/library/dd145120(VS .85).aspx [ ^ ]
May be you can StretchBlt() the image to a bigger rectangle. http://msdn.microsoft.com/en-us/library/dd145120(VS.85).aspx[^]


感谢您的回复,
我已经搜索了SetCapture函数,但我对msdn不太了解.
任何人都可以更轻松地解释它.
Thanks for replying,
I''ve searched for the SetCapture function I''ve not understand very well the msdn.
Can anyone explain it more easy.


这篇关于缩放按钮中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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