如何在mfc对话框中添加放大和缩小功能? [英] how to add zoom in and zoom out feature in mfc dialog?
本文介绍了如何在mfc对话框中添加放大和缩小功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我是mfc的新手可以任何人告诉我如何在mfc中添加放大和缩小功能??
thanx
Hi I am new to mfc can any one tell me how to add zoom in and zoom out feature in mfc??
thanx
推荐答案
请使用StretchBlt函数创建缩放效果。
Please use StretchBlt function to create zoomed effect.
BOOL StretchBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int nHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
DWORD dwRop // raster operation code
);
更改nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc t o根据缩放和平移。
更改nXOriginSrc,nYOriginSrc将提供平移效果。更改nWidthSrc,nHeightSrc将提供缩放/取消缩放效果。
以下文章可能会帮助您创建位图的缩放/平移效果。
CZoomCtrl:A Picture通过缩放和滚动控制 [ ^ ]
这篇关于如何在mfc对话框中添加放大和缩小功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文