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
 
 
 
 
 
TitleVerify that JPG files are smaller and slower than BMP files
KeywordsJPG, BMP, JPEG, GIF, bitmap, image, size, speed
CategoriesGraphics, Controls
 
Images are stored in a form or PictureBox's Picture property in the form from which they were loaded. They are converted into bitmaps when they are displayed at run time.

To save space, load the pictures from compressed JPEG or GIF files. This will save space in the form's FRX file and in the compiled executable.

This also makes the program take longer to convert the image into a bitmap for display at runtime. To save display time, load pictures from BMP files.

 
Private Sub cmdBMP_Click()
Dim start_time As Single

    start_time = Timer
    FormBMP.Show
    MsgBox Format$(Timer - start_time, "0.00") & " seconds"
End Sub

Private Sub cmdJPEG_Click()
Dim start_time As Single

    start_time = Timer
    FormJPEG.Show
    MsgBox Format$(Timer - start_time, "0.00") & " seconds"
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated