Why is this workaround for SaveToFile needed? lazarus / 39-Graphics ---------------------------------------------------------------------- gwiesenekker · 2014-06-03 12:38 Hi, I copy one bitmap to another using: BitBlt(TImage-instance.Picture.Bitmap.Canvas.Handle, 0, 0, TImage- instance.Picture.Bitmap.Width, TImage-instance.Picture.Bitmap.Height, hdcSrc, SourceRect.Left, SourceRect.Top, SRCCOPY); The Timage-instance is a component on the main form, and shows the copied bitmap correctly. However, if I save this bitmap to a file using: TImage-instance.Picture.Bitmap.SaveToFile('Bitmap.bmp'); the resulting bitmap is always black. I found the workaround in another thread: pic := TPicture.Create; pic.bitmap.width := TImage-instance.Picture.Bitmap.width; pic.bitmap.height := TImage-instance.Picture.Bitmap.height; pic.bitmap.Canvas.Draw(0, 0, TImage-instance.Picture.Bitmap); pic.SaveToFile('Bitmap.bmp'); pic.Free; But why is this workaround for SaveToFile needed? Gijsbert ---------------------------------------------------------------------- engkin · 2014-06-09 02:49 Quote from: gwiesenekker on June 03, 2014, 02:38:28 pmBut why is this workaround for SaveToFile needed? It is not needed. When you deal with handles directly you need to call Changed when you're done: Code: [Select]BitBlt(TImage-instance.Picture.Bitmap.Canvas.Handle, 0, 0, TImage-instance.Picture.Bitmap.Width, TImage- instance.Picture.Bitmap.Height, hdcSrc, SourceRect.Left, SourceRect.Top, SRCCOPY); TImage-instance.Picture.Bitmap.Canvas.Changed;  //<----