Si tu as une méthode qui donne directement la taille en pixel ou quelque chose qui remplace mon ratio...
MsgBox ScaleX(blabla.Width, vbHimetric, vbPixels) & vbCrLf & ScaleY(blabla.Height, vbHimetric, vbPixels)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionFunction Taille_Image(Fichier As String) As String Dim Img As Object Dim Haut, Wide, Resolution As Long On Error Resume Next Set Img = CreateObject("WIA.ImageFile") Img.LoadFile Fichier Resolution = Img.HorizontalResolution Wide = Img.Width Haut = Img.Height Taille_Image = Str(CLng(Haut)) & "x" & Str(CLng(Wide)) End Function
j'ai voulu prendre uniquement la taille de l'image.
Set blabla = LoadPicture("C:\Images\Test.jpg") MsgBox blabla.Width & vbCrLf & blabla.Height
Function TailleImage(Fichier As String, FichierNew As String) As String Const Ratio = 26.458005 Dim oPict As New stdole.StdPicture Dim Tmp As String Dim H As Single Dim L As Single Tmp = Repertoire & Fichier On Error Resume Next Set oPict = stdole.LoadPicture(Tmp) H = oPict.Height / Ratio L = oPict.Width / Ratio TailleImage = Str(CLng(H)) & "x" & Str(CLng(L)) End Function