TAdvWebBrowser screenshot issue

I'm not familiar with Delphi, does it look like the same as my C++ code ?

TPngImage * pPNGImage = new TPngImage();
try
{
  pPNGImage->Assign(AScreenShot->Bitmap);
  pPNGImage->SaveToFile(strFileName);
}
__finally
{
  delete pPNGImage;
}

Otherwise moving to this for the clipboard works well

Word MyFormat;
THandle AData;
HPALETTE APalette;

AScreenShot->SaveToClipboardFormat(MyFormat, AData, APalette);
Clipboard()->SetAsHandle(MyFormat, AData);