Option Explicit
Public Sub Datei_Auswahl()
Dim strDatei As String
Dim strDummy As String
Dim ff As Integer
Dim c As Integer
Dim S As String
Dim L As Long
Dim JPGWidth As Long
Dim JPGHeight As Long
With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = "C:\"
.Title = "Dateiauswahl"
.ButtonName = "Auswahl..."
.Filters.Add "JPG-Dateien", "*.jpg; *.jpeg", 1
.InitialView = msoFileDialogViewList
If .Show = -1 Then
strDatei = .SelectedItems(1)
Else
MsgBox "Es wurde keine Datei ausgewaehlt!"
Exit Sub
End If
End With
ff = FreeFile()
Open strDatei For Binary Access Read As #ff
If Input(2, #ff) <> (Chr$(&HFF) & Chr$(&HD8)) Then
Close #ff
Exit Sub
End If
strDummy = Input(2, #ff)
Do
L = Asc(Input(1, #ff))
L = L * 256 + Asc(Input(1, #ff))
S = Input(L - 2, #ff)
If c = &HC0 Or c = &HC2 Then
JPGWidth = Asc(Mid$(S, 4, 1))
JPGWidth = JPGWidth * 256 + Asc(Mid$(S, 5, 1))
JPGHeight = Asc(Mid$(S, 2, 1))
JPGHeight = JPGHeight * 256 + Asc(Mid$(S, 3, 1))
End If
If Input(1, #ff) <> Chr$(255) Then
Exit Do
End If
c = Asc(Input(1, #ff))
Loop While c <> &HD9
Close #ff
MsgBox "Die Grafik " & strDatei & " ist " & vbNewLine & _
CStr(JPGWidth) & " Pixel breit und " & vbNewLine & _
CStr(JPGHeight) & " Pixel hoch.", _
vbInformation, "JPG-Analyse"
End Sub
Daten aus Kombinationsfeld in Textfeld auslesen lassen
Evolut1on 10.09.2009 - 302 Hits - 1 Antwort
Access 2007, Formular aufrufen ohne Access 2007 aufzurufen?
Mufti 18.09.2009 - 734 Hits - 3 Antworten
Wert aus Pivottabelle auslesen
Peter3011 27.10.2009 - 625 Hits - 4 Antworten
ini-Datei auslesen
morpheus__85 22.01.2010 - 254 Hits - 2 Antworten
Name des aktiven Registerblattes auslesen
Peter3011 10.02.2010 - 192 Hits - 3 Antworten