1

如何在我的表单上绘制水平斑马线?

1px Black
1px White
1px Black
1px White
1px Black
1px White
1px Black
1px White
4

1 回答 1

1

你可以这样做:

Dim Zebra As New Bitmap(Me.Width, Me.Height)
For y = 0 To Zebra.Height - 1
    For x = 0 To Zebra.Width - 1
        If y Mod 2 <> 0 Then
            Zebra.SetPixel(x, y, Color.Black)
        Else
            Zebra.SetPixel(x, y, Color.White)
        End If
    Next
Next
Me.BackgroundImage = Zebra


(1 px 线)

于 2012-11-01T22:33:17.893 回答