Mince j'ai oublié de te coller le code : le voici ....
dans les variables ImgPrtH mettre la taille del'image et dans ImgPrtW mettre la largeur de l'image.
Public Sub PrintImage()
With PrinterIf FrmMain.Image1.Visible False Or FrmMain.Image1.Picture 0 Then MsgBox ("Pas de fichier séléctionné !"): Exit Sub
Dim Reponse$
If ImgPrtW > ImgPrtH And .Orientation = vbPRORPortrait Then
Reponse = MsgBox("La largeur de l'image est plus grande que sa hauteur." & vbCrLf & _
"Lancer l'impression en orientation Paysage ?", vbYesNoCancel + vbQuestion)
If Reponse = vbYes Then
.Orientation = vbPRORLandscape
ElseIf Reponse = vbCancel Then Exit Sub
End If
End If
If ImgPrtH > ImgPrtW And .Orientation = vbPRORLandscape Then
Reponse = MsgBox("L'hauteur de l'image est plus grande que sa largeur." & vbCrLf & _
"Lancer l'impression en orientation Portrait ?", vbYesNoCancel + vbQuestion)
If Reponse = vbYes Then
.Orientation = vbPRORPortrait
ElseIf Reponse = vbCancel Then Exit Sub
End If
End If
Dim DistX As Long, DistY&, Coef As Double
If ImgPrtH > .Height - 2000 Then
Coef = ImgPrtH / (.Height - 2000)
ImgPrtH = .Height - 2000
ImgPrtW = ImgPrtW / Coef
End If
If ImgPrtW > .Width - 800 Then
Coef = ImgPrtW / (.Width - 800)
ImgPrtW = .Width - 800
ImgPrtH = ImgPrtH / Coef
End IfDistX (.Width / 2) - (ImgPrtW / 2): DistY (.Height / 2) - (ImgPrtH / 2)
.ScaleMode = vbTwips
.FontName = "Comic Sans MS"
.FontSize = 8
.CurrentX = (.ScaleWidth - .TextWidth(ImgPrtName)) / 2
Printer.Print ImgPrtName
Printer.PaintPicture FrmMain.Image1, DistX, DistY, ImgPrtW, ImgPrtH
Printer.EndDoc
End With
End Sub