procedure SaveBmpFromPaintBox(pbox: TPaintBox; fn: string);varbmp: TBitmap;r: TRect;beginbmp := TBitmap.Create;bmp.Width := pbox.Width;bmp.Height := pbox.Height;try
PaintBox1.Refresh