110,566
社区成员
发帖
与我相关
我的任务
分享
Bitmap bmp = new Bitmap(48, 48);
Graphics g = Graphics.FromImage(bmp);
Font font = new Font("宋体", 36.0f);
Brush blackBrush = new SolidBrush(Color.Black);
Brush whiteBrush = new SolidBrush(Color.White);
g.FillRectangle(whiteBrush, 0, 0, 48, 48);
g.DrawString("我", font, blackBrush, new PointF(-8, 0));
g.Save();
pictureBox1.Image = bmp;
byte[,] matrix = new byte[48, 48];
for (int y = 0; y < 47; y++)
{
for (int x = 0; x < 47; x++)
{
Color pixel = bmp.GetPixel(x, y);
if (pixel.R == 0 && pixel.G == 0 && pixel.B == 0)
matrix[x, y] = 0x1;
}
}
Bitmap bmp = new Bitmap(48, 48);
Graphics g = Graphics.FromImage(bmp);
Font font = new Font("宋体", 36.0f);
Brush blackBrush = new SolidBrush(Color.Black);
Brush whiteBrush = new SolidBrush(Color.White);
g.FillRectangle(whiteBrush, 0, 0, 48, 48);
g.DrawString("我", font, blackBrush, new PointF(-8, 0));
g.Save();
pictureBox1.Image = bmp;
byte[,] matrix = new byte[48, 48];
for (int y = 0; y < 47; y++)
{
for (int x = 0; x < 47; x++)
{
if (bmp.GetPixel(x, y) == Color.Black)
matrix[x, y] = 0x1;
}
}