void GuardarImagenDelControl(TWinControl *Control, AnsiString FileName)
{
HDC DC;
Graphics::TBitmap *BitmpPrueba = new Graphics::TBitmap();
try{
BitmpPrueba->Width = Control->Width;
BitmpPrueba->Height = Control->Height;
DC = GetWindowDC(Control->Handle);
BitBlt(BitmpPrueba->Canvas->Handle, 0, 0, Control->Width, Control->Height, DC, 0, 0, SRCCOPY);
ReleaseDC(Control->Handle, DC);
BitmpPrueba->SaveToFile(FileName);
}
__finally{
delete BitmpPrueba;
}
}