我可以在mfc图片控件中使用鼠标事件吗? [英] Can I use mouse event in mfc picture control?

查看:302
本文介绍了我可以在mfc图片控件中使用鼠标事件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在图片控件上裁剪图像.
谢谢.

I would like to crop the image which on picture control.
Thanks in advanced.

推荐答案

可以通过设置PictureControl的窗口区域来实现裁剪.
请通过跟踪LButtonDown和LButtonUp消息来确定要裁剪的区域.
然后设置PictureControl的窗口区域
Cropping can be implemented by setting window region of the PictureControl.
Please identify region for cropping by tracking LButtonDown and LButtonUp messages.
Then set window region of the PictureControl
  CRgn clipregion;
clipregion.CreateRectRgn( left, top,  right, bottom ); // Prepare clip region.
pPictureControl->SetWindowRgn(clipregion, TRUE);


这篇关于我可以在mfc图片控件中使用鼠标事件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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