110,567
社区成员
发帖
与我相关
我的任务
分享
Bitmap bmp=new Bitmap(200,500);
Graphics g = Graphics.FromImage(bmp); ;// e.Graphics;
//横网格
Pen backpen = new Pen(Color.FromArgb(cIDE_INFO.colorBack.ToArgb()-0x00404040)); //背景色变暗40
backpen.DashStyle = DashStyle.Custom; //.DashDotDot;
backpen.DashPattern = new float[] { 1, 6 };
for (float i = cIDE_INFO.ideCodeSize.Height / 2; i < pictureBox1.Height; i += cIDE_INFO.ideCodeSize.Height)
{
g.DrawLine(backpen, 0, i, pictureBox1.Width, i);
}
//竖网格
for (float i = cIDE_INFO.ideCodeSize.Width / 2; i < cIDE_INFO.ideCodeVnum * cIDE_INFO.ideCodeSize.Width; i += cIDE_INFO.ideCodeSize.Width)
{
g.DrawLine(backpen, i, 0, i, pictureBox1.Height);
}
//画指令
//todo:要翻页
Point tp=new Point();
foreach (ArrayList tzls in ide_all_zls)
{
tp.X = 0;
foreach (object tzl in tzls)
{
cIDE_INFO.ideDrawMove(tp, g);
if (tzl != null)
{
if (tzl.GetType() == typeof(ide.code_type))
{
cIDE_INFO.DrawZL((ide.code_type)tzl, g);
if (((ide.code_type)tzl).分支 == true)
{
cIDE_INFO.ideDrawMove(tp, g);
cIDE_INFO.DrawV(g);
}
}
else if (tzl.GetType() == typeof(string))
{
string tstr = (string)tzl;
if (tstr.IndexOf("H") >= 0)
{
cIDE_INFO.DrawH(g);
}
}
}
tp.X++;
}
tp.Y++;
}
//画当前插入点 反色处理
g.ResetTransform();
pictureBox1.Image = bmp;