//水平百叶窗
public void Effect_BaiYeH(Bitmap obmp, Bitmap bmp, PictureBox pic)
{
int step = 30;
try
{
Bitmap bmp1 = (Bitmap)bmp.Clone();
int height = bmp1.Height / step;
int width = bmp1.Width;
Graphics g = Graphics.FromImage(obmp);
Point[] MyPoint = new Point[step];
for (int y = 0; y < step; y++)
{
MyPoint[y].X = 0;
MyPoint[y].Y = y * height;
}
Bitmap bitmap = new Bitmap(bmp.Width, bmp.Height);
for (int i = 0; i < height; i++)
{
for (int j = 0; j < step; j++)
{
for (int k = 0; k < width; k++)
{
bitmap.SetPixel(MyPoint[j].X + k, MyPoint[j].Y + i, bmp.GetPixel(MyPoint[j].X + k, MyPoint[j].Y + i));
}
}
pic.Refresh();
pic.Image = bitmap;
System.Threading.Thread.Sleep(20);
}
g.Dispose();
bmp1.Dispose();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "错误")
【自用】C# 中图片切换的几种过渡动画特效
最新推荐文章于 2022-05-31 09:00:00 发布
本文介绍如何在C#中实现图片切换时的过渡动画特效,详细讲解了不同类型的动画效果及其代码实现,适合C#开发者参考学习。
摘要由CSDN通过智能技术生成