Un tres bon visualisateur d'images
Source / Exemple :
Private Sub Command2_Click()
' Vérifie la légende, puis la modifie.
If Command2.Caption = "A propos" Then
Command2.Caption = "Information"
Else
Command2.Caption = "A propos"
End If
'Information
CL$ = Chr$(13) + Chr$(10)
Titre$ = "Information"
Msg$ = "Programme de visualisation bitmap 32-Bits" + CL$
Msg$ = Msg$ + "Carlier patrick" + CL$
Msg$ = Msg$ + " " + CL$
Msg$ = Msg$ + "76.600 le HAVRE"
MsgBox Msg$, vbInformation, Titre$
End Sub
Private Sub Command3_Click()
FormDia.Show vbModal
End Sub
Private Sub Command4_Click()
On Error GoTo TraiteErreur
Dim Source As String
Dim Cible As String
Source = File1.Path
If Right(Source, 1) <> "" Then Source = Source & ""
Source = Source & File1.filename
Dialog.Flags = 2
Dialog.ShowSave
Cible = Dialog.filename
FileCopy Source, Cible
File1.Refresh
Exit Sub
TraiteErreur:
If Err.Number = 32755 Then Exit Sub
MsgBox Err.Description, 16, "Erreur !"
End Sub
Private Sub Command5_Click()
On Error GoTo TraiteErreur
ChDrive Drive1.Drive
ChDir File1.Path
Kill (File1.filename)
File1.Refresh
Exit Sub
TraiteErreur:
MsgBox Err.Description, 16, "Erreur !"
End Sub
Private Sub Command6_Click()
FormAid.Show vbModal
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo TraiteErreur
Dir1.Path = Drive1.Drive
Exit Sub
'Lecteur absent
TraiteErreur:
Dim Réponse As Integer
Réponse = MsgBox(Err.Description, 5, "Erreur !")
If Réponse = 4 Then Resume
End Sub
Private Sub File1_Click()
Image1.Width = 4000
Image1.Height = 4800
If Check1.Value = 1 Then
Image1.Stretch = True
Else
Image1.Stretch = False
End If
'Lecture du nom de fichier
Chemin$ = Dir1.Path
If Right$(Chemin$, 1) <> "" Then
Chemin$ = Chemin$ + ""
End If
Fichier$ = Chemin$ + File1.filename
Image1.Picture = LoadPicture(Fichier$)
Fichier$ = Path$ + File1.filename
Label2 = "Nom de l'Image:" & File1.filename
End Sub
Private Sub File1_PathChange()
' Affiche le chemin d'accès dans le contrôle Label.
Label1.Caption = "Chemin: " & Dir1.Path
End Sub
Private Sub Command1_Click()
'Fin du programme
M$ = "Voulez-vous vraiment quitter le programme de visualisation ?"
Réponse% = MsgBox(M$, vbYesNo + vbQuestion, "Quitter le programme")
If Réponse% = vbYes Then
End
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Option Explicit
Private Sub Form_Load()
Dim Fichier As String
Fichier = Form1.File1.Path
If Right(Fichier, 1) <> "" Then Fichier = Fichier & ""
Fichier = Fichier & Form1.File1.filename
ImageDia.Picture = LoadPicture(Fichier)
ImageDia.Top = (Screen.Height - ImageDia.Height) / 2
ImageDia.Left = (Screen.Width - ImageDia.Width) / 2
End Sub
Private Sub ImageDia_DblClick()
Unload Me
End Sub
Private Sub ImageDia_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Dim Fichier As String
Fichier = Form1.File1.Path
If Right(Fichier, 1) <> "" Then Fichier = Fichier & ""
Select Case Button
Case 1
Form1.File1.ListIndex = Form1.File1.ListIndex - 1
Case 2
Form1.File1.ListIndex = Form1.File1.ListIndex + 1
End Select
Fichier = Fichier & Form1.File1.filename
ImageDia.Picture = LoadPicture(Fichier)
ImageDia.Top = (Screen.Height - ImageDia.Height) / 2
ImageDia.Left = (Screen.Width - ImageDia.Width) / 2
End Sub
Private Sub Timer1_Timer()
Dim Fichier As String
Fichier = Form1.File1.Path
If Right(Fichier, 1) <> "" Then Fichier = Fichier & ""
If Form1.File1.ListIndex = Form1.File1.ListCount - 1 Then
Unload Me
Exit Sub
End If
Form1.File1.ListIndex = Form1.File1.ListIndex + 1
Fichier = Fichier & Form1.File1.filename
ImageDia.Picture = LoadPicture(Fichier)
ImageDia.Top = (Screen.Height - ImageDia.Height) / 2
ImageDia.Left = (Screen.Width - ImageDia.Width) / 2
'Lecture du nom de fichier
Label2 = "" & Form1.File1.filename
End Sub
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.