您的位置:首页 > 娱乐 > 八卦 > 四川省人民政府2023年森林防火命令_竞价外包推广_企业官网seo_百度小说搜索风云榜排行榜

四川省人民政府2023年森林防火命令_竞价外包推广_企业官网seo_百度小说搜索风云榜排行榜

2024/12/23 6:12:09 来源:https://blog.csdn.net/ftfmatlab/article/details/143392801  浏览:    关键词:四川省人民政府2023年森林防火命令_竞价外包推广_企业官网seo_百度小说搜索风云榜排行榜
四川省人民政府2023年森林防火命令_竞价外包推广_企业官网seo_百度小说搜索风云榜排行榜

首先看特效

  1. 开启双缓冲

SetStyle(ControlStyles.ResizeRedraw| ControlStyles.DoubleBuffer| ControlStyles.UserPaint| ControlStyles.AllPaintingInWmPaint| ControlStyles.SupportsTransparentBackColor,true);

  2.设置窗体透明、鼠标穿透、窗体置顶


this.TransparencyKey = this.BackColor = System.Drawing.SystemColors.Control;
this.TopMost = true;

3.设置定时器

_timer = new System.Timers.Timer();_timer.Elapsed += _timer_Elapsed;_timer.Interval = 140;_timer.Start();

4.设置图像

5.添加窗体Paint事件


private void FrmEffects_Paint(object? sender, PaintEventArgs e)
{e.Graphics.Smooth();_effects?.Draw(e.Graphics);e.Graphics.Smooth(false);
}

 窗体全部源码:


public partial class FrmEffects : Form{private readonly System.Timers.Timer _timer;private readonly IEffects _effects;public FrmEffects(){InitializeComponent();SetStyle(ControlStyles.ResizeRedraw| ControlStyles.DoubleBuffer| ControlStyles.UserPaint| ControlStyles.AllPaintingInWmPaint| ControlStyles.SupportsTransparentBackColor,true);this.TransparencyKey = this.BackColor = System.Drawing.SystemColors.Control;this.TopMost = true;_effects = new DragonHorseEffects();_timer = new System.Timers.Timer();_timer.Elapsed += _timer_Elapsed;_timer.Interval = 140;_timer.Start();this.Paint += FrmEffects_Paint;this.SizeChanged += FrmEffects_SizeChanged;this.MouseMove += FrmEffects_MouseMove;this.MouseUp += FrmEffects_MouseUp;this.MouseDown += FrmEffects_MouseDown;this.SizeChanged += FrmEffects_SizeChanged;this.Shown += FrmEffects_Shown;this.FormClosing += FrmEffects_FormClosing;}private void FrmEffects_FormClosing(object? sender, FormClosingEventArgs e){_effects?.Dispose();}private void FrmEffects_Shown(object? sender, EventArgs e){Screen screen = Screen.PrimaryScreen;this.Location = new System.Drawing.Point(screen.Bounds.Width - this.Width, screen.Bounds.Height - this.Height - 50);}private void _timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e){_effects?.Business();this.Invalidate();}private void FrmEffects_SizeChanged(object? sender, EventArgs e){}private void FrmEffects_MouseDown(object? sender, MouseEventArgs e){}private void FrmEffects_MouseUp(object? sender, MouseEventArgs e){}private void FrmEffects_MouseMove(object? sender, MouseEventArgs e){}private void FrmEffects_Load(object sender, EventArgs e){}private void FrmEffects_Paint(object? sender, PaintEventArgs e){e.Graphics.Smooth();_effects?.Draw(e.Graphics);e.Graphics.Smooth(false);}}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com