04-02-13, 02:55 PM
M.Sami.AK كتب :هنا لعرض الصورة من موقع بالجهاز :
PHP كود :
' Function for loading the icon from disk in 48x48 size '
Private Function LoadIconFromFile(ByVal fileName As String) As Icon
Return New Icon(fileName, New Size(48, 48))
End Function
' code for loading the icon into a PictureBox '
Dim theIcon As Icon = LoadIconFromFile("C:\path\file.ico")
pbIcon.Image = theIcon.ToBitmap()
theIcon.Dispose()
' code for drawing the icon on the form, at x=20, y=20 '
Dim g As Graphics = Me.CreateGraphics()
Dim theIcon As Icon = LoadIconFromFile("C:\path\file.ico")
g.DrawIcon(theIcon, 20, 20)
g.Dispose()
theIcon.Dispose()
هنا لعرض الصور من الريسورس :
PHP كود :
Private Function LoadIconFromFile(ByVal fileName As String) As Icon
Dim result As Icon
Dim assembly As System.Reflection.Assembly = Me.GetType().Assembly
Dim stream As System.IO.Stream = assembly.GetManifestResourceStream((assembly.GetName().Name & ".file.ico"))
result = New Icon(stream, New Size(48, 48))
stream.Dispose()
Return result
End Function
تحياتي للجميع
ابـــو سامـــي
جزاك الله خير اخى
