Vb.net绘制水平斑马线

时间:2012-11-01 22:30:34

标签: .net vb.net winforms

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

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

1 个答案:

答案 0 :(得分: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行)