开发者

c# load image into PictureBox without slowing down UI

I am trying to load 720x480 bitmaps into a picturebox very quickly and while loading the images into the picturebox, the UI of my application slows down considerably. Is there any way around it ? I read that when using a backgroundworker, I cannot load the image into the picturebox control开发者_高级运维 in the DoWork event ..

What are my options ?

Thanks


It depends on from where you are getting image. If it comes from network drive or from web or database then BackgroundWorker will definitely help you. Get the image in DoWork handler and assign the image to PictureBox in the RunWorkerCompleted handler.


You could try using the PictureBox.LoadAsync method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜