图片框循环时在DO中线程超时 [英] Thread time out in DO while loop of a picturebox

查看:63
本文介绍了图片框循环时在DO中线程超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用do while循环来打印图片框中图片的RGB值.如果我使用大尺寸图片,则它为小图片高度和宽度打印RGB值.它没有响应或线程时间不足60分钟.给出一些程序代码以打印HIGH宽度和高度的图片RGB值而没有响应或快速...我的代码是

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

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

推荐答案

我猜你正在杀死列表框

如果您的图片是1024 * 1024,那么您试图将超过100万个项目放入列表框

也许将其放入日志文件会更容易...
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 ...


这篇关于图片框循环时在DO中线程超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆