字符动画个人觉得更具挑战性,可惜没那么多时间和精力来独自研究。
本文示例 利用系统线程实现将图片轮播配上音乐还原视屏原效果。
功能包括暂停播放,继续播放.
另外本示例以 Bad Apple为例。将视屏每帧转成图片,网上工具很多,可以网上搜索一下。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[System.Runtime.InteropServices.DllImport("winmm.dll")]
public static extern uint mciSendString(string lpstrCommand, string lpstrReturnString, uint uReturnLength, uint hWndCallback);
private volatile bool isStop;
private int i = 1;
private Thread t = null;
private string pathstr =