dans le code suivant, je ne comprends pas pourquoi, lorsque l'on fait ASSIGN de l'image Image1, qui d'après la doc est une COPIE dans le bitmap temporaire, l'image disparait de l'écran.
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
22
23
24
25
26
27 interface uses... type TForm1 = class(TForm) Image1: TImage; Button1: TButton; procedure Button1Click(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); end; var Form1: TForm1; BitMapTemp: TBitMap; implementation {$R *.dfm} //-------------------------------------------- procedure TForm1.Button1Click(Sender: TObject); begin BitMapTemp := TBitMap.Create; BitMapTemp.Assign(Image1.Picture.Bitmap); // <---l'image Image1 disparait de la fiche end; //-------------------------------------------- procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin BitMapTemp.Free; end;
Partager