1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| PIC_Wallpaper1.Width = Me.Width
PIC_Wallpaper1.Height = Me.Height
If PIC_Wallpaper0.Width < PIC_Wallpaper1.Width And PIC_Wallpaper0.Height < PIC_Wallpaper1.Height Then
Coeff = 1
X = (PIC_Wallpaper1.Width - PIC_Wallpaper0.Width) / 2
Y = (PIC_Wallpaper1.Height - PIC_Wallpaper0.Height) / 2
GoTo Affiche_image
End If
'definition du coefficient selon l'orientation de l'image
If PIC_Wallpaper0.Width > PIC_Wallpaper0.Height Then
Coeff = PIC_Wallpaper0.Width / PIC_Wallpaper1.Width
X = 0
Y = (PIC_Wallpaper1.Height - (PIC_Wallpaper0.Height / Coeff)) / 2
Else
Coeff = PIC_Wallpaper0.Height / PIC_Wallpaper1.Height
X = (PIC_Wallpaper1.Width - (PIC_Wallpaper0.Width / Coeff)) / 2
Y = 0
End If
Affiche_image:
NewLargeur = PIC_Wallpaper0.Width / Coeff
NewHauteur = PIC_Wallpaper0.Height / Coeff
PIC_Wallpaper1.PaintPicture PIC_Wallpaper0.Picture, X, Y, NewLargeur, NewHauteur |
Partager