LoadPicture

Fermé
Sinistrus Messages postés 1017 Date d'inscription mercredi 12 décembre 2007 Statut Membre Dernière intervention 6 juin 2023 - 1 janv. 2013 à 14:02
 un_neurone - 1 janv. 2013 à 14:22
Bonjour à tous et bonne année !

Je débute cette année avec un petit problème d'affichage d'image :s

Ce code me permet d'afficher l'image PIC_Wallpaper0 dans PIC_Wallpaper1
    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
Il fonctionne très bien, mais je souhaite que chaque chaque jour il affiche une nouvelle image (au load) dans le PIC_wallpaper0 et qu'il soit pris en compte par PIC_wallpaper1.

Avez-vous une idée svp ?

1 réponse

bha si ton code c'est vraiment ça, je dirais que t'as pas déclaré ton PIC_Wallpaper0
0