PictureBox

shachr23

New member
PictureBox

Dim theImage As Image = Image.FromFile(fileName) Me.PictureBox1.Image = theImage theImage.Dispose()​
זה בערך הקוד שלי כאשר אני בודק לפני אם קיימת תמונה כך:
Dim fileName As String = App_Path() & "picture.jpg" If IO.File.Exists(fileName) Then​
משום מה זה לא עובד... ואני לא מכיר את השגיאות של VB.NET ... אולי מישהו יכול לעזור? תודה!
 

shachr23

New member
אוקיי הסתדרתי עם זה...

הבנתי ממאמר של מיקרוסופט שלהריץ את זה כשה FORM עולה גורם לבעיה..
Dim fileName As String = App_Path() & "picture.jpg" Dim fs As System.IO.FileStream ' Load the picture if its Exists. If IO.File.Exists(fileName) Then fs = New IO.FileStream(fileName, IO.FileMode.Open, IO.FileAccess.Read) PictureBox1.Image = Drawing.Image.FromStream(fs) fs.Close() picLoaded = True Else GB_Photo.Text = "Error Loading..." End If​
זה עובד.. עכשיו אני רוצה בעצם לשים איזה LISTENER או משהו בכדי שאני אוכל להראות PROGRESSBAR של התמונה נטענת.. איך אני יכול לדעת מה מצב טעינת התמונה? תודה!
 
למעלה