문제

I am using "ImageLocation" property of PictuerBox to get a picture from the web.

PB1.ImageLocation = "http://www.example.com/picture.png"

Some times the image which has to load in picture box from web is very large in size and can not be appear instantly in PictureBox. I need to conform that Image has successfully loaded in Picturebox, before performing next operation. I have to Enable some controls just after loading of image from web.

Is there any way to conform this? (Note: My PictureBox has an initial image also.)

도움이 되었습니까?

해결책

Use the PictureBox.LoadCompleted event.

다른 팁

Okay see what I did for mine was just download the picture. The image normally takes a while to start getting put into the picture box.

Here is my code:

If (My.Computer.FileExists("http://www.example.com/picture.png")) Then
  My.Computer.Network.DownloadFile("http://www.example.com/picture.png", <Some Location>)
  PB1.ImageLocation = <Some location>
 Else
  End
End If

It may not be the most efficient way - but I can see it as a simple way of making it work.

Dunno if it's working or not, can't access Visual Studio at the moment

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top