送上测试代码
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim binary_frame As New Binary.CSunsafe
binary_frame.BMP_Init(PictureBox1.Image)
pic = binary_frame.Binary_L(0.6)
debug(pic, 50, 85)
End Sub
Public Function debug(ByVal pic(,) As Integer, ByVal width As Integer, ByVal height As Integer)
Dim bmp As New Bitmap(width + 1, height + 1)
Dim i, j As Integer
For i = 0 To width
For j = 0 To height
If pic(i, j) = 1 Then
bmp.SetPixel(i, j, Color.Black)
End If
Next
Next
Dim frm As New Form
frm.BackgroundImage = bmp
frm.BackgroundImageLayout = ImageLayout.Center
frm.Show()
Return Nothing
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim binary_frame As New Binary.CSunsafe
binary_frame.BMP_Init(PictureBox1.Image)
pic = binary_frame.Binary_L(0.6)
debug(pic, 50, 85)
End Sub
Public Function debug(ByVal pic(,) As Integer, ByVal width As Integer, ByVal height As Integer)
Dim bmp As New Bitmap(width + 1, height + 1)
Dim i, j As Integer
For i = 0 To width
For j = 0 To height
If pic(i, j) = 1 Then
bmp.SetPixel(i, j, Color.Black)
End If
Next
Next
Dim frm As New Form
frm.BackgroundImage = bmp
frm.BackgroundImageLayout = ImageLayout.Center
frm.Show()
Return Nothing
End Function