Bonjour � toutes et � tous,
Dans une ancienne application, je charge des photos dans un Timage depuis le m�me dossier de l'application.
Ma question si on cr�e un fichier ressource, il faudra faire l'extraction 7 fois si il y a 7 photos ?
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 //Chargement : ImageFiles := TStringList.Create; ImageFiles.Add('Chat.jpg'); ImageFiles.Add('Chat_1.jpg'); ImageFiles.Add('Chat_2.jpg'); ImageFiles.Add('Chat_3.jpg'); ImageFiles.Add('Chat_4.jpg'); ImageFiles.Add('Chat_5.jpg'); ImageFiles.Add('Chat_6.jpg'); ImageIndex := 0; image1.Picture.LoadFromfile(ImageFiles[ImageIndex]);
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10 //Mon RC : Photo RCDATA "Chat.jpg" Photo1 RCDATA "Chat_1.jpg" Photo2 RCDATA "Chat_2.jpg" Photo3 RCDATA "Chat_3.jpg" Photo4 RCDATA "Chat_4.jpg" Photo5 RCDATA "Chat_5.jpg" Photo6 RCDATA "Chat_6.jpg"J'avais pens� a un fichier Zip en ressource puis l'extraire mais avec D6 je ne penses pas que c'est faisable.
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 //Lecture procedure TU_Form.BLectureClick(Sender: TObject); var RS: TResourceStream; JPGImage: TJPEGImage; begin JPGImage := TJPEGImage.Create; try RS := TResourceStream.Create(hInstance, 'Photo', RT_RCDATA); try JPGImage.LoadFromStream(RS); Image1.Picture.Graphic := JPGImage; finally RS.Free; end; finally JPGImage.Free; end; end;
Si quelqu'un a une id�e merci d'avance.
@+,
cincap