求百叶窗效果显示图片源码(c#),谢谢!
另外,大家是否买了那个Visual C#2005编程技巧大全的书呢,提供下源码好吗,谢谢![email protected],小弟感激不尽!
另外,大家是否买了那个Visual C#2005编程技巧大全的书呢,提供下源码好吗,谢谢![email protected],小弟感激不尽!
解决方案 »
- 求翻牌抽奖算法
- DataGrid 绑定 ArrayList 时设置样式问题?
- 含webbrowser的winform control嵌入webform的问题,求有经验的达人提示一下~
- 关于进度显示
- 关于节假日的问题,有难度,等好汉揭帖
- 如何判断xls文件是否已打开!
- 抽取网页内容的算法 C#
- 做windows程序时TreeView的一个属性问题?(高分)
- 异常:当传递具有已修改行的DataRow集合时,更新要求有效的UpdateCommand
- 用来显示内容的页面如何在鼠标双击时实现滚屏。
- 请教“控制不能从一个 case 标签(“case 0:”)贯穿到另一个 case 标签”?
- C#使用ESC/POS 命令直接打印怎么做
{
//垂直百叶窗显示图像
try
{
MyBitmap = (Bitmap)this.pictureBox1.Image.Clone();
int dw = MyBitmap.Width / 30;
int dh = MyBitmap.Height;
Graphics g = this.pictureBox1.CreateGraphics();
g.Clear(Color.Gray);
Point[] MyPoint = new Point[30];
for (int x = 0; x < 30; x++)
{
MyPoint[x].Y = 0;
MyPoint[x].X = x * dw;
}
Bitmap bitmap = new Bitmap(MyBitmap.Width, MyBitmap.Height);
for (int i = 0; i < dw; i++)
{
for (int j = 0; j < 30; j++)
{
for (int k = 0; k < dh; k++)
{
bitmap.SetPixel(MyPoint[j].X + i, MyPoint[j].Y + k, MyBitmap.GetPixel(MyPoint[j].X + i, MyPoint[j].Y + k));
}
}
this.pictureBox1.Refresh();
this.pictureBox1.Image = bitmap;
System.Threading.Thread.Sleep(100);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息提示");
}
} 水平百叶窗实现代码如下: private void button3_Click(object sender, EventArgs e)
{
//水平百叶窗显示图像
try
{
MyBitmap = (Bitmap)this.pictureBox1.Image.Clone();
int dh = MyBitmap.Height / 20;
int dw = MyBitmap.Width;
Graphics g = this.pictureBox1.CreateGraphics();
g.Clear(Color.Gray);
Point[] MyPoint = new Point[20];
for (int y = 0; y < 20; y++)
{
MyPoint[y].X = 0;
MyPoint[y].Y = y * dh;
}
Bitmap bitmap = new Bitmap(MyBitmap.Width, MyBitmap.Height);
for (int i = 0; i < dh; i++)
{
for (int j = 0; j < 20; j++)
{
for (int k = 0; k < dw; k++)
{
bitmap.SetPixel(MyPoint[j].X + k, MyPoint[j].Y + i, MyBitmap.GetPixel(MyPoint[j].X + k, MyPoint[j].Y + i));
}
}
this.pictureBox1.Refresh();
this.pictureBox1.Image = bitmap;
System.Threading.Thread.Sleep(100);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息提示");
}
}