1.放一个panel,设置panel的背景图.
2.对背景图进行处理.
private void zbtnsubmit_Click(object sender, EventArgs e)
{
try
{
Bitmap oldmap = (Bitmap)this.zpal.BackgroundImage.Clone();
int intWidth = oldmap.Width;
int intHeight = oldmap.Height / 20;
Graphics myGraphics = this.zpal.CreateGraphics();
myGraphics.Clear(Color.WhiteSmoke);
Point[] myPoint = new Point[30];
for (int i = 0; i < 30; i++)
{
myPoint[i].X = 0;
myPoint[i].Y = i * intHeight;
}
Bitmap bitmap = new Bitmap(oldmap.Width, oldmap.Height);
for (int m = 0; m < intHeight; m++)
{
for (int n = 0; n < 20; n++)
{
for (int j = 0; j < intWidth; j++)
{
bitmap.SetPixel(myPoint[n].X + j, myPoint[n].Y + m, oldmap.GetPixel(myPoint[n].X + j, myPoint[n].Y + m));
}
}
this.zpal.Refresh();
this.zpal.BackgroundImage = bitmap;
System.Threading.Thread.Sleep(100);
}
}
catch { }
}
实现百叶窗类似效果