C# develops WeChat, QR code mouse slides, image shows hidden effect

高洛峰
Release: 2016-12-20 14:08:18
Original
1575 people have browsed it

When the client WeChat is in the QR code state, when the mouse slides over, a picture of the mobile phone will slide out, from hiding to showing, and from showing to hiding.

The idea is very simple: 1. Set the transparency; 2. Give a moving displacement

Let’s take a look at the effect first

C#开发微信 二维码鼠标滑动 图像显示隐藏效果

The overall code is not difficult, just set the animation effect for the Image control.









 







 

















Copy after login

But one thing to note is that you need to set a property IsHitTestVisible="False" for the Image control. The explanation on MSDN is "If this element can be returned as a hit test result from at least one point, it is true, otherwise it is false. The default value is true. "

It is very important to set this attribute. Because this attribute is not set, I adjusted the animation all morning and did not achieve the desired effect. Let me show you what it is without setting IsHitTestVisible="False" Effect.

C#开发微信 二维码鼠标滑动 图像显示隐藏效果

Since the Image is below the Grid, there is no problem when the mouse slowly slides in from the left, because the mouse cannot click on the Image. However, if the mouse slides too fast and touches the Image, it will continue to The MouseEnter event is triggered, resulting in constant flickering.

When IsHitTestVisible="False" is set, the Image will not be clicked and there will be no impact.

The above is the C# development WeChat QR code mouse sliding effect that the editor introduces to you. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank you all for your support of the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!