Bonjour,
je souhaite copier une portion de ce qui est afficher dans un composant (un composant père, TForm, TPanel...) dans un de ses fils, une TImage puis dans le canevas du composant.
voici un essai :
et là bien sûr ça ne fonctionne pas. J'ai chercher sur internet et pourtant ça m'a l'air bon.
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 var hdcParent, hdcSelf : HDC; begin // Ne donne pas le même hdc pourquoi ? //hdcParent := Self.Canvas.Handle ; hdcParent := GetDC(Self.Handle) ; //hdcSelf := GetDC(Panel1.Handle) ; // ne fonctionne pas hdcSelf := Image1.Canvas.Handle ; BitBlt(hdcParent, 0, 0, 100, 100, hdcSelf, 0, 0, SRCCOPY); ReleaseDC(Self.Handle, hdcParent); ReleaseDC(Panel1.Handle, hdcSelf); end ;
Quelqu'un aurait-il l'explication ?
Partager