in my program you can see this code:
VB Code:
  1. Private Sub Command1_Click()
  2. Dim i As Long
  3.     For i = 0 To File1.ListCount - 1 'start loop
  4.    
  5.         File1.ListIndex = i 'set current file
  6.        
  7.         Picture1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName) 'load picture
  8.        
  9.         JPG.Create Picture1.ScaleWidth, Picture1.ScaleHeight 'create empty jpeg with correct size
  10.         BitBlt JPG.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hdc, 0, 0, vbSrcCopy 'blit pic into empty jpeg
  11.         SaveJPG JPG, Dir1.Path & "\" & Mid(File1.FileName, 1, Len(File1.FileName) - 3) & "jpg", Slider1.Value 'save jpeg
  12.     Next
  13. End Sub

first it starts a loop to do all bmp files in the list (For i = 0 To File1.ListCount - 1)

then it sets the current index of the loop to the file list to be able get the filename (File1.ListIndex = i)

then it loads this picture into the picturebox (Picture1.Picture = LoadPicture(Dir1.Path & "\" & File1.FileName))

then it creates an empty jpg, blit from the pixeturebox into it, then saves it with the selected compression.



if you also want to be able to load jpg's you have to select the filelist...goto the property "Pattern", and change it from "*.bmp;*.gif" to "*.bmp;*.gif;*.jpg"

to stretch it, you have to declare the StretchBlt API:
VB Code:
  1. Private Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long

then change this line:
JPG.Create Picture1.ScaleWidth, Picture1.ScaleHeight
to whatever new size you want.

then change this line:
BitBlt JPG.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hdc, 0, 0, vbSrcCopy
to use StretchBlt instead