预加载PictureBox所需的图像(.net)

时间:2022-12-03 22:09:49

I'm currently using the ImageLocation property of some PictureBoxs on a form of mine. The location is online but the images need to load before they are displayed. The problem is, the images sometimes change to other pictures, but because of this, it doesn't display anything for a couple of seconds because the pictures haven't loaded. Is it somehow possible to preload the specific image links during the application startup so that the images don't only load when they are set as the ImageLocation source?

我目前正在使用某些PictureBox的ImageLocation属性。该位置在线,但图像需要在显示之前加载。问题是,图像有时会改变为其他图片,但由于这一点,它几秒钟内都没有显示任何内容,因为图片没有加载。是否有可能在应用程序启动期间预加载特定的图像链接,以便图像不仅在设置为ImageLocation源时加载?

I'm using VB.net but all .net answers are usable and appreciated!

我正在使用VB.net,但所有的.net答案都可以使用和赞赏!

1 个解决方案

#1


1  

You should be able to solve this by using the Image property instead of the ImageLocation property. During the application startup, you can load the images into variables, and when the form loads, you can assign each image variable to its respective PictureBox's Image property.

您应该能够使用Image属性而不是ImageLocation属性来解决此问题。在应用程序启动期间,您可以将图像加载到变量中,并且在加载表单时,可以将每个图像变量分配给其各自的PictureBox的Image属性。

#1


1  

You should be able to solve this by using the Image property instead of the ImageLocation property. During the application startup, you can load the images into variables, and when the form loads, you can assign each image variable to its respective PictureBox's Image property.

您应该能够使用Image属性而不是ImageLocation属性来解决此问题。在应用程序启动期间,您可以将图像加载到变量中,并且在加载表单时,可以将每个图像变量分配给其各自的PictureBox的Image属性。