Bonjour,
Dans ce bout de procédure je souhaite redimensionner une image. Le problème c'est que j'ai la fonction "except" qui se déclenche lorsque j'impose des mesures
Quelqu'un pourrait me dire pourquoi
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 if (ImgExt = '.jpg') or (ImgExt = '.jpeg') then begin try Jpg := TJpegImage.Create; Jpg.LoadFromFile(ExtractFilePath(Application.ExeName)+ 'photo-timbre/'+enregcollec.photo); largeur:=Jpg.Width; hauteur:=Jpg.Height; ratio:=hauteur/largeur; if (ratio>1.15) and (ratio<1.22) then begin Jpg.Width:=130; Jpg.Height:=155; end; affiche.Image1.Picture.Bitmap.Assign(Jpg); except affiche.Image1.Picture.Bitmap.LoadFromFile(ExtractFilePath(Application.ExeName)+ 'photo-timbre/0000.bmp'); end; Jpg.Free; end; // fin de if (ImgExt = '.jpg') or (ImgExt = '.jpeg')
Partager