Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleGenerate a file giving the dimensions of the JPEG files in a directory
Description
Keywordspicture, JPEG, dimensions, size
CategoriesActiveX, Graphics
 
Tom Frecka developed this utility to determine the dimensions of the JPEG files in a directory. The program lets you select a directory using the DriveList, DirList, and FileList controls. When you click the Go button, the program uses the following code to loop through the JPEG files in the directory. The program uses LoadPicture to load each picture into the hidden Image control imgJPEGSize and writes the controls dimensions into a text file.
 
Private Sub cmdJPEGSize_Click()
    
    Static JPEGFile As String
    
    MousePointer = 11
    Target = dirJPEGSize.Path + "\JPEGSizes.txt"
    Open Target For Output As #6
    
    For i = 0 To filJPEGSize.ListCount - 1
        JPEGFile = dirJPEGSize.Path + "\" + _
            filJPEGSize.List(i)
        imgJPEGSize.Picture = LoadPicture(JPEGFile)
        Print #6, JPEGFile; vbTab; imgJPEGSize.Width; _
            vbTab; imgJPEGSize.Height
    Next i
    
    Close
    
    imgJPEGSize.Picture = LoadPicture("")
    msg = "The width and height of the JPEG graphics " + _
        vbCrLf
    msg = msg + "have been written to " + Target
    
    Reply = MsgBox(msg, vbInformation, "JPEG File Width & " & _
        "Height")
    MousePointer = 0
    
End Sub
 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated