SkyRocKo
Messages postés174Date d'inscriptionsamedi 10 mai 2003StatutMembreDernière intervention18 février 2006
-
17 sept. 2005 à 22:32
SkyRocKo
Messages postés174Date d'inscriptionsamedi 10 mai 2003StatutMembreDernière intervention18 février 2006
-
24 sept. 2005 à 20:56
Bonsoir à tous,
J'ai intégré à mon project un fichier GIF, je peux si je veux je sauver sur le disque dur comme ceci:
Private Sub Form_Load()
SaveResData 101, "GIF", "C:\MonImage.gif"
End Sub
Sub SaveResData(ByVal ID As Integer, ByVal IDtype, ByVal FilePath As String)
Dim b() As Byte, intFileName As Integer
b = LoadResData(ID, IDtype)
intFileName = FreeFile
Open FilePath For Binary As #intFileName
Put #intFileName, , b
Close #intFileName
End Sub
Cependant, je souhaiterais avoir une fonction du même genre sauf
qu'elle n'enregistre pas les octets dans un fichier mais les renvoie
directement dans un String, par ex :
Private Sub Form_Load()
Dim strBuffer as string
strBuffer = GetResData(101, "GIF")
End Sub
Function GetResData(ByVal ID As Integer, ByVal IDtype) As String
GetResData = CStr(LoadResData(ID, IDtype))
End Sub
Comment rendre cette fonction correcte car je ne comprends pas l'utilisation d'une variable de type Byte