• 49 Vote(s) - 2.37 Average
  • 1
  • 2
  • 3
  • 4
  • 5
بارگذاری عکس بصورت انلاین در پیکشر باکس
#1

Load image from URL into PictureBox
This is a snippet to load an image from a URL into a PictureBox on a Windows form

PHP Code:
InstructionsNeed reference to

System.Net 
System
.Drawing 

سورس کد

PHP Code:
Public Sub LoadImageFromUrl(ByRef url As StringByVal pb As PictureBox)
    
Dim request As Net.HttpWebRequest DirectCast(Net.HttpWebRequest.Create(url), Net.HttpWebRequest)
    
Dim response As Net.HttpWebResponse DirectCast(request.GetResponseNet.HttpWebResponse)
    
Dim img As Image Image.FromStream(response.GetResponseStream())
    
response.Close()
    
pb.SizeMode PictureBoxSizeMode.StretchImage
    pb
.Image img
End Sub 

گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)