短视频带货源码,观看视频时双击放大

短视频带货源码,观看视频时双击放大实现的相关代码

1.在播放视频的DIALOG里面获取当前播放框

1
<br>CRect curRect;<br>GetClientRect(&curRect);

​2.确定当前需要放大的倍数,确定放大后的框长和宽(z为倍数)。

1
<br>normalWidth = curRect.right;<br>normalHeight = curRect.bottom;<br>amplifyWidth = curRect.right * z;<br>amplifyHeight = curRect.bottom * z;<br>else <br>{<br>if (point.x<normalWidth / 2*z)<br>{<br>if (point.y < normalHeight / 2*z || point.y>normalHeight - normalHeight / 2*z)<br>{<br>if (point.y<normalHeight / 2*z)<br>{<br>MoveWindow(0, 0, amplifyWidth, amplifyHeight);<br>}<br>else<br>{<br>MoveWindow(0, -(amplifyHeight - normalHeight), amplifyWidth, amplifyHeight);<br>}<br>}<br>else<br>{<br>MoveWindow(0, -point.y * z+0.5*normalHeight, amplifyWidth, amplifyHeight);<br>}<br>}<br>else if (point.x>normalWidth - normalWidth / 2*z)<br>{<br>if (point.y < normalHeight / 2*z || point.y>normalHeight - normalHeight / 2*z)<br>{<br>if (point.y<normalHeight / 2*z)<br>{<br>MoveWindow(-(amplifyWidth - normalWidth), 0, amplifyWidth, amplifyHeight);<br>}<br>else<br>{<br>MoveWindow(-(amplifyWidth - normalWidth), -(amplifyHeight - normalHeight), amplifyWidth, amplifyHeight);<br>}<br>}<br>else<br>{<br>MoveWindow(-(amplifyWidth - normalWidth), -point.y * z+0.5*normalHeight, amplifyWidth, amplifyHeight);<br>}<br>}<br>else if (point.y<normalHeight / 2*z) <br>{<br>MoveWindow(-point.x * z+0.5*normalWidth, 0, amplifyWidth, amplifyHeight);<br>}<br>else <br>{<br>MoveWindow(-point.x * z+0.5*normalWidth, -(amplifyHeight - normalHeight), amplifyWidth, amplifyHeight);<br>}

3.到这里逻辑性的代码基本上就结束了。如果要进行放大,以及放大还原。那就在外面套一层if判断。

1
<br>if (isZoom==false)<br>{<br>isZoom=true;<br>········<br>}<br>else<br>{<br>MoveWindow(0,0,normalWidth,normalHeight);<br>isZoom = false;<br>}

以上就是 短视频带货源码,观看视频时双击放大实现的相关代码,更多内容欢迎关注之后的文章

 

posted @   云豹科技-苏凌霄  阅读(131)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示