0

假设我想创建宽度和高度为 64 的图像并将所有像素设置为黑色

dim b as bitmap

b.width = 64
b.height = 64

for y = 0 to 64
    for x = 0 to 64
        b.setpixel(x,y ,color.black)
    next
next

dim p as new panel

p.width = b.width
p.hieght = b.height
p.backgroundimage(b)

代码不起作用

4

1 回答 1

0
    Dim b As Bitmap = New Bitmap(64, 64)

    For y = 0 To 64

        For x = 0 To 64

            b.SetPixel(x, y, Color.Black)

        Next

    Next

    b.Save("bitmap1.bmp")
于 2012-06-21T18:24:54.943 回答