Thursday, 2 October 2014

Cara merubah image to hexadecimal pada vb6

berikut adalah cara merubah atau konversi dari image ke hexadecimal pada vb6

Private Sub cmdImageToHex_Click()
 Dim s As String
 s = Image2Hex(App.Path & "\t-rex.gif")
 Open App.Path & "\t-rex_hex.txt" For Binary As #1
 Put #1, 1, s
 Close #1
End Sub


Public Function Image2Hex(ByVal sFileName As String) As String
 Dim hFile As Integer, bArr() As Byte
   
 On Error Resume Next
   
 If Len(Dir$(sFileName, vbHidden Or vbSystem)) = 0 Then
   Call MsgBox("Can't find the file", vbCritical, "Error")
   Exit Function
 End If
   
 hFile = FreeFile
  
 Open sFileName For Binary Access Read As #hFile
       
 If Err.Number = 0 Then
   ReDim bArr(LOF(hFile) - 1)
           
   Get #hFile, , bArr
           
   Image2Hex = ByteArr2Hex(bArr)
 Else
   Call MsgBox("Can't open the file", vbCritical, "Error")
 End If
   
 Close #hFile
End Function


Download aplikasi project nya di mari
http://www.4shared.com/rar/Bqx9p-7xce/imagetostring.html
Perhatian: Yuk Baca Artikel bagus di Nurul Musthofa

Artikel Terkait

No comments:

Post a Comment

 

Network

Pesan

Semoga situs ini bermanfaat