我用如下方式画了一张图片
Bitmap tp1 = new Bitmap(w, h);
if (chars1.Length == w/2 * h)
{
for (int i = 0; i < w/2; i++)
for (int j = 0; j < h; j++)
{
if (chars1[(i * h + j)].ToString() == "1")
tp1.SetPixel(i * tableSpace, j, Color.Black);
else
tp1.SetPixel(i * tableSpace, j, Color.White);
}
}
Graphics g = System.Drawing.Graphics.FromImage(result);//新建一个画板
g.DrawImage(tp1, new Rectangle(currentCol, currentLine, w, h));
请问我怎么去查看这张图片,不是保存
Bitmap tp1 = new Bitmap(w, h);
if (chars1.Length == w/2 * h)
{
for (int i = 0; i < w/2; i++)
for (int j = 0; j < h; j++)
{
if (chars1[(i * h + j)].ToString() == "1")
tp1.SetPixel(i * tableSpace, j, Color.Black);
else
tp1.SetPixel(i * tableSpace, j, Color.White);
}
}
Graphics g = System.Drawing.Graphics.FromImage(result);//新建一个画板
g.DrawImage(tp1, new Rectangle(currentCol, currentLine, w, h));
请问我怎么去查看这张图片,不是保存
解决方案 »
- 用DataContractSerializer反序列化对象,能否忽略属性的顺序?
- wpf 应用资源
- 请教C#多线程的用法
- WINFORM写记事本时候的问题
- 如何通过DataGridView更新数据库
- 急!急!急!急!100分求助IP地址问题,怎么让本机“自动获得IP”,获得的ip地址是DHCP指派的???
- 如何让应用程序只有一个实例运行?
- C#中文文件名的问题
- 请介绍基本关于“算法”方面的书。
- 关于IP地址的一些问题。
- 一个有关checkedlistbox控件在vs2008版本中不能更改selectionmode属性的问题
- C#中将mysql中的datetime字段赋值给DateTimePicker控件
this.PictureBox1.Image = img;
那个result就是一个Image吗?
那为什么不直接
pictureBox1.Image = result;