Here is one of my functions, hope you can extract the relevant bits you require. Look-up help on LoadPicture for more info
'Get dimensions of picture and limit them (NB pngs don't work ...doh)
Function PictureLimit(byVal strPath, byRef strWidth, byRef strHeight)
Dim strExt, colSplit, objPict, intW, intH, strDebug
If (FileExists(strPath)) Then
colSplit = split(strPath, "."

strExt = colSplit(UBound(colSplit))
Select Case Lcase(strExt)
Case "bmp", "ico", "rle", "wmf", "emf", "gif", "jpg"
'writedebug Path='" & strPath & "'"
Set objPict = LoadPicture(strPath)
intW = Round(objPict.Width/26.5) + 1
intH = Round(objPict.Height/26.5) + 1
Set objPict = Nothing
'strDebug = "Path='" & strPath & "'" & vbTab & "Width=" & strWidth & " Height=" & strHeight & vbTab & "RawWidth=" & intW & " RawHeight=" & intH
' Check if sizes are within bounds, if the are then don't limit them
' Limit height by default
If (IsNumeric(strHeight)) Then
' Calculate new size if required
if (CInt(strHeight)<intH) Then
intW = Round(intW * CInt(strHeight) / intH)
intH = CInt(strHeight)
Else
strHeight = ""
End If
' Extra width limiting
If (IsNumeric(strWidth)) Then
If (intW >= CInt(strWidth)) Then
strHeight = Round(intH * CInt(strWidth) / intW)
End If
End if
strWidth = ""
Else
If (intW < CInt(strWidth)) Then strWidth = ""
End if
PictureLimit = ""
If (strWidth<>""

Then PictureLimit = PictureLimit & " WIDTH=" & strWidth & ""
If (strHeight<>""

Then PictureLimit = PictureLimit & " HEIGHT=" & strHeight & ""
'strDebug = strDebug & vbTab & "Limit='" & PictureLimit & "'"
'writeinfo strDebug
'response.end
End Select
End If
End Function