change debug writeline to textbox.text

  • Thread starter Thread starter Identity80
  • Start date Start date
I

Identity80

Guest
Hi all,

i am very beginner,and my english is very bad too. I need little help.

I find one very good program from sim0n :Get the amount and colour of pixels in an Image

([VB.Net] Q: Get the amount and colour of pixels in an Image tried to send him/her an email,but his/her email address is invalid.

I need use this program with textbox (without debug writeline ).

Thank you very much for your help.



Dim [COLOR=rgb(-1,-1,-1)]PixelList As New [COLOR=rgb(-1,-1,-1)]List([/COLOR]Of String[COLOR=rgb(-1,-1,-1)]())

[/COLOR]Public Sub [COLOR=rgb(-1,-1,-1)]ColourInList([/COLOR]ByVal [COLOR=rgb(-1,-1,-1)]Colour [/COLOR]As [COLOR=rgb(-1,-1,-1)]Color)
[/COLOR]Dim [COLOR=rgb(-1,-1,-1)]Found [/COLOR]As Boolean [COLOR=rgb(-1,-1,-1)]= [/COLOR]False
[COLOR=rgb(-1,-1,-1)] [/COLOR]For Each [COLOR=rgb(-1,-1,-1)]str [/COLOR]As String[COLOR=rgb(-1,-1,-1)]() [/COLOR]In [COLOR=rgb(-1,-1,-1)]PixelList
[/COLOR]If [COLOR=rgb(-1,-1,-1)]str(0) = [/COLOR]CStr[COLOR=rgb(-1,-1,-1)](Colour.ToArgb) [/COLOR]Then
[COLOR=rgb(-1,-1,-1)] str(1) = [/COLOR]CStr[COLOR=rgb(-1,-1,-1)]([/COLOR]CInt[COLOR=rgb(-1,-1,-1)](str(1)) + 1)
Found = [/COLOR]True
[COLOR=rgb(-1,-1,-1)] [/COLOR]Exit For
[COLOR=rgb(-1,-1,-1)] [/COLOR]End If
[COLOR=rgb(-1,-1,-1)] [/COLOR]Next
[COLOR=rgb(-1,-1,-1)] [/COLOR]If [COLOR=rgb(-1,-1,-1)]Found = [/COLOR]False Then [COLOR=rgb(-1,-1,-1)]PixelList.Add([/COLOR]New String[COLOR=rgb(-1,-1,-1)]() {[/COLOR]CStr[COLOR=rgb(-1,-1,-1)](Colour.ToArgb), 1})
[/COLOR]End Sub

[COLOR=rgb(-1,-1,-1)] [/COLOR]Private Sub [COLOR=rgb(-1,-1,-1)]PictureBox1_Click([/COLOR]ByVal [COLOR=rgb(-1,-1,-1)]sender [/COLOR]As [COLOR=rgb(-1,-1,-1)]System.Object, [/COLOR]ByVal [COLOR=rgb(-1,-1,-1)]e [/COLOR]As [COLOR=rgb(-1,-1,-1)]System.EventArgs) [/COLOR]Handles [COLOR=rgb(-1,-1,-1)]PictureBox1.Click
[/COLOR]Dim [COLOR=rgb(-1,-1,-1)]btmp [/COLOR]As New [COLOR=rgb(-1,-1,-1)]Bitmap(PictureBox1.Image)
[/COLOR]For [COLOR=rgb(-1,-1,-1)]x [/COLOR]As Integer [COLOR=rgb(-1,-1,-1)]= 0 [/COLOR]To [COLOR=rgb(-1,-1,-1)]btmp.Width - 1
[/COLOR]For [COLOR=rgb(-1,-1,-1)]y [/COLOR]As Integer [COLOR=rgb(-1,-1,-1)]= 0 [/COLOR]To [COLOR=rgb(-1,-1,-1)]btmp.Height - 1
ColourInList(btmp.GetPixel(x, y))
[/COLOR]Next
[COLOR=rgb(-1,-1,-1)] [/COLOR]Next
[COLOR=rgb(-1,-1,-1)] [/COLOR]For Each [COLOR=rgb(-1,-1,-1)]str [/COLOR]As String[COLOR=rgb(-1,-1,-1)]() [/COLOR]In [COLOR=rgb(-1,-1,-1)]PixelList
Debug.WriteLine(Color.FromArgb(str(0)).ToString & [/COLOR]" | Count: " [COLOR=rgb(-1,-1,-1)]& str(1))
[/COLOR]Next
[COLOR=rgb(-1,-1,-1)] [/COLOR]End Sub
[/COLOR]




https://sim0n.wordpress.com/2009/03/30/vbnet-q-get-the-amount-and-colour-of-pixels-in-an-image/

Continue reading...
 
Back
Top