创建动画按钮 [英] Create Animated Button

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

问题描述

我有按钮可以在点击时创建动画吗?

I have button it possible create animate on click?

使用 photoshop 我创建了两个图像(启用和禁用).在 Windows 窗体中插入图片框并单击事件..单击图像从启用变为禁用,但您可以有动画吗?

with photoshop i have created a two image (enabled and disabled). Insert the picturebox in Windows Forms and Click event..Click the image changes from enabled to disabled, but you can have an animation?

像这样:

推荐答案

使用 GIF 不需要计时器.

A timer is not required using a GIF.

使用 Windows 窗体,您可以从为每个按钮创建动画 GIF 开始.它必须包括向前和向后的方向.您可以通过 Photoshop 通过动画"面板执行此操作.在 PictureBox 单击事件中,您可以设置图像播放或停止.

Using windows forms you could start by creating an animated GIF for each button. It would have to include both the forward and backwards direction. You can do this through Photoshop via the "Animation" panel. On the PictureBox click event you can set the image to play or stop.

下面的代码会将您的图像设置在开始帧上.

The code below would set your image on the beginning frame.

imgButtonDimension = new FrameDimension(imgButtonDimension.FrameDimensionsList[0]);
imgButton.SelectActiveFrame(imgButtonDimension, 0);
pictureBox.Image = imgButton;`

如果这是您想要采用的方法,我可以提供进一步的详细说明.

If this is the approach you'd like to take I can provide further elaboration.

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

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