日期:2014-05-17 浏览次数:20784 次
private void DrawImage(string s)
{
StringBuilder sb = new StringBuilder();
string[] s1 = s.Replace("\r\n", "|").Split('|');
int l, w;
l = l4;
w = a4;
Bitmap bmp = new Bitmap(l, w);
Graphics draw = Graphics.FromImage(bmp);
draw.Clear(Color.Black);
Color c = Color.FromArgb(255);
Pen p = new Pen(c);
p.Color = Color.FromArgb(255);
for (int i = 0; i < w; i++)
{
for (int a = 0; a < l*2; a++)
{
#region
switch (s1[i].Substring(a, 2))
{
case "00":
{
p.Color = Color.FromArgb(0, 255, 0);
draw.DrawRectangle(p, a/2, i, 1, 1);
a++;
break;
}