别说丑...种子扫描算法..[就是平推]- Option Explicit
- Private Declare Function GetPixel _
- Lib "gdi32" (ByVal hdc As Long, _
- ByVal x As Long, _
- ByVal y As Long) As Long
- Private Sub cmdText_Click()
- With picBox
- .Cls
- .ForeColor = vbYellow
- picBox.Print "This is a test."
- End With
- End Sub
- Private Sub cmdWork_Click()
- Dim x As Single, y As Single, w As Single, h As Single
- Dim strOut As String, strTmp As String, lngTmp As Long
- With picBox
- w = .Width
- h = .Height
- End With
- strOut = ""
- strTmp = ""
- For x = 0 To w
- For y = 0 To h
- lngTmp = GetPixel(picBox.hdc, x, y)
- If lngTmp = 0 Then
- strTmp = "x:" & x & " y:" & y & vbNewLine
- strOut = strOut & strTmp
-
- End If
-
- Next
-
- Next
- txtOut = strOut
- End Sub
- Private Sub cmdXor_Click()
- With picBox
- .DrawMode = vbXorPen
- picBox.Line (0, 0)-(.Width, .Height), vbYellow, BF
- End With
- End Sub
复制代码 |