Click here to Skip to main content
15,903,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used do while loop for print RGB value of the picture in picture box.it print RGB value for small picture height and width.if i use large size picture it not responding or thread time 60 minutes out.Give some program code to print HIGH width and height picture RGB value with out not respond or Quick......my code is
VB
Private Sub btn_getPixels_Click(ByVal sender As Object, ByVal e As EventArgs)
        listBox1.Items.Add("Pixel             Color")
        Try 
            Dim img As Bitmap = New Bitmap(pictureBox1.Image)
            Dim c As Color
            Dim i As Integer = 0
            Do While (i < img.Width)
                Dim j As Integer = 0
                Do While (j < img.Height)
                    c = img.GetPixel(i, j)
                    listBox1.Items.Add((i.ToString + (","  _
                                    + (j.ToString + ("             " + c.Name)))))
                    j = (j + 1)
                Loop
                i = (i + 1)
            Loop
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
Posted
Updated 26-Jul-12 18:30pm
v2

1 solution

I'd guess you're killing the listbox

If your picture is 1024 * 1024 then you're trying to put more than 1 million items into a listbox

Perhaps putting it into a logfile would be easier ...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900