1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Sub extract_image_catiapart2()
Dim OBJstream, BB() As Byte, b As Long, bytTemp(0 To 1) As Byte, tablo, by As Byte
Set OBJstream = CreateObject("ADODB.Stream") 'object utilisé ADODB stream
OBJstream.Open: OBJstream.Type = 1 ' open with no arguments makes the stream an empty container
OBJstream.LoadFromFile ("C:\Users\polux\Desktop\PartsansCCP.CATPart") 'on load le fichier dans l'object
BB = OBJstream.Read() ' on prend directement tout le paquet
'**************************************
ReDim tablo(UBound(BB))
For i = 0 To UBound(BB): tablo(i) = BB(i): Next
code = "255,216" & Split(Split(Join(tablo, ","), "255,216")(1), "255,217")(0)
tablo = Split(code, ",")
jpegFile = FreeFile
Open "C:\Users\polux\Desktop\PartsansCCP.jpg" For Binary Access Write Lock Write As jpegFile
For i = 0 To UBound(tablo)
If IsNumeric(tablo(i)) Then by = tablo(i): Put jpegFile, , by
Next i
Close jpegFile
End Sub |
Partager