TempBild.Picture.SaveToFile('TempBild.jpg');
and everything is finef you copy from canvas to canvas this has to be done in the OnPaint event of Form1.No, the canvas should be locked/unlocked with beginupdate/endupdate. OnPaint has nothing to do with it. On the contrary, you should prevent access - so prevent paint at all during the operation..
Basically you can do it anywhere, but make sure you use BeginUpdate/EndUpdate.
But if I put the code outside of FormPaint, nothing happens, only if I insert it inside FormPaint.
I think you're confused. You don't put a component in foreground with CopyRect.Perhaps this is my bad english that leads to misunderstandings.
TempBild.Picture.SaveToFile('TempBild.jpg');
The image, I find afterwards on my harddisk is the one I expected.Doing CopyRight from the canvas of a component that is not visible is not supposed to work.I have never seen any supporting document, which mention, that it is necessary, that the image must be visible whilst you call CopyRect
Form1.DoubleBuffered := false
to save some memory space.Now I had to put CopyRect within FormPaint (see my posts above), so I generated a flickering image in Windows (not in Linux).The OnPaint event happens just after the background of the form is cleared. So that's the best place to minimize flickering.
I don't thing that I need TBitmap, TImage is sufficientIn my view, it is the other way around. TImage is TBitmap + a control to display on the screen. So TBitmap is sufficient and TImage is superfluous.
The Canvas of the control is the screen unless the system or framework creates a bitmap to store its content (like DoubleBuffered). So doing the CopyRect could just try to copy the pixels from the screen.Doing CopyRight from the canvas of a component that is not visible is not supposed to work.I have never seen any supporting document, which mention, that it is necessary, that the image must be visible whilst you call CopyRect