do loop hang and not resopnding while running langtime.how rectify this
-
I have picture box control.Using picture box.Height and picture box.Width in do loop i read the pixel information.**When i use large resolution image(height and width of the image is more)**it hang and not respond.how rectify this or set progress bar until the loop ends. dim i,j as integer dim img as image img=picturebox1.image do(i
-
I have picture box control.Using picture box.Height and picture box.Width in do loop i read the pixel information.**When i use large resolution image(height and width of the image is more)**it hang and not respond.how rectify this or set progress bar until the loop ends. dim i,j as integer dim img as image img=picturebox1.image do(i
leostalin91 wrote:
**When i use large resolution image(height and width of the image is more)**it hang and not respond.how rectify this or set progress bar until the loop ends.
Would need to be executed on it's own thread, otherwise the UI-thread does not get the chance to repaint. The easiest way to do so, and add a progressbar, is using a
BackgroundWorker
[^].Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
I have picture box control.Using picture box.Height and picture box.Width in do loop i read the pixel information.**When i use large resolution image(height and width of the image is more)**it hang and not respond.how rectify this or set progress bar until the loop ends. dim i,j as integer dim img as image img=picturebox1.image do(i
i think, you can add Application.doevents in ur looping.. :)
-
I have picture box control.Using picture box.Height and picture box.Width in do loop i read the pixel information.**When i use large resolution image(height and width of the image is more)**it hang and not respond.how rectify this or set progress bar until the loop ends. dim i,j as integer dim img as image img=picturebox1.image do(i
i think, you can add Application.doevents in u looping.. :)
-
i think, you can add Application.doevents in ur looping.. :)
That's the most dangerous way to do it as DoEvents will allow you to click other buttons and possibly make the code reentrant. The appropriate method is to farm the work off to a background thread.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
That's the most dangerous way to do it as DoEvents will allow you to click other buttons and possibly make the code reentrant. The appropriate method is to farm the work off to a background thread.
A guide to posting questions on CodeProject[^]
Dave KreskowiakI agree with Dave you need to process this on a background thread so the UI can update itself.