For i = 1 To 128
bitinfo = tempzw(i)
bitmap = &H80
For k = 1 To 8
getbit = bitinfo And bitmap
If getbit = 0 Then
Picture1.FillColor = &H0
Else
Picture1.FillColor = &HF0
End If
Picture1.Circle ((i - 1) * 6 + 2, (k - 1) * 6 + 2), 3, &H80
bitmap = bitmap / 2
Next k
Next iFor i = 1 To 128
bitinfo = tempzw(i + 128)
bitmap = &H80
For k = 1 To 8
getbit = bitinfo And bitmap
If getbit = 0 Then
Picture1.FillColor = &H0
Else
Picture1.FillColor = &HF0
End If
Picture1.Circle ((i - 1) * 6 + 2, (k - 1) * 6 + 2 + 8 * 6), 3, &H80
bitmap = bitmap / 2
Next k
Next i
其中bitinfo、 bitmap 、getbit是byte类型 ,tempzw是一个256的数组,&H80是十六进制
bitinfo = tempzw(i)
bitmap = &H80
For k = 1 To 8
getbit = bitinfo And bitmap
If getbit = 0 Then
Picture1.FillColor = &H0
Else
Picture1.FillColor = &HF0
End If
Picture1.Circle ((i - 1) * 6 + 2, (k - 1) * 6 + 2), 3, &H80
bitmap = bitmap / 2
Next k
Next iFor i = 1 To 128
bitinfo = tempzw(i + 128)
bitmap = &H80
For k = 1 To 8
getbit = bitinfo And bitmap
If getbit = 0 Then
Picture1.FillColor = &H0
Else
Picture1.FillColor = &HF0
End If
Picture1.Circle ((i - 1) * 6 + 2, (k - 1) * 6 + 2 + 8 * 6), 3, &H80
bitmap = bitmap / 2
Next k
Next i
其中bitinfo、 bitmap 、getbit是byte类型 ,tempzw是一个256的数组,&H80是十六进制
同时修炼者,轻则四五葬身之地,重则终身不孕不育!
得分的人下场就是证明!
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
this.pictureBox1.Paint+=new PaintEventHandler(pictureBox1_Paint);
} void pictureBox1_Paint(object sender, PaintEventArgs e)
{
byte bitinfo=0;
byte bitmap = 0;
byte getbit = 0;
byte[] tempzw = new byte[257];
for (int i = 1; i <= 128; i++)
{
bitinfo = tempzw[i];
bitmap = 0x80;
for (int k = 1; k <= 8; k++)
{
getbit = (byte)(bitinfo & bitmap);
Color c1;
Color c2;
if (getbit == 0)
{
c1 = Color.FromArgb(0, 0, 0);
}
else
{
c1 = Color.FromArgb(0xf0, 0, 0);
} c2 = Color.FromArgb(0x80, 0, 0); using (Pen pen1 = new Pen(c2))
{
e.Graphics.DrawEllipse(pen1, (i - 1) * 6 + 2 - 3, (k - 1) * 6 + 2 - 3, 3, 3);
} using (Pen pen2 = new Pen(c1))
{
Brush bh = pen2.Brush;
e.Graphics.FillEllipse(bh, (i - 1) * 6 + 2 - 3, (k - 1) * 6 + 2 - 3, 3, 3);
bh.Dispose();
}
bitmap = (byte)(bitmap / 2);
}
}
for (int i = 1; i <= 128; i++)
{
bitinfo = tempzw[i + 128];
bitmap = 0x80;
for (int k = 1; k <= 8; k++)
{
getbit = (byte)(bitinfo & bitmap);
Color c1;
Color c2;
if (getbit == 0)
{
c1 = Color.FromArgb(0, 0, 0);
}
else
{
c1 = Color.FromArgb(0xf0, 0, 0);
} c2 = Color.FromArgb(0x80, 0, 0); using (Pen pen1 = new Pen(c2))
{
e.Graphics.DrawEllipse(pen1, (i - 1) * 6 + 2 - 3, (k - 1) * 6 + 2 + 6 * 8 - 3, 3, 3);
} using (Pen pen2 = new Pen(c1))
{
Brush bh = pen2.Brush;
e.Graphics.FillEllipse(bh, (i - 1) * 6 + 2 - 3, (k - 1) * 6 + 2 + 6 * 8 - 3, 3, 3);
bh.Dispose();
}
bitmap = (byte)(bitmap / 2);
}
}
}
}
}