[Solved] Picture in the Windows clipboard- how to save it to a file? lazarus / 31-LCL ---------------------------------------------------------------------- AlexTP · 2021-02-05 15:54 User has a picture in clipboard. E.g. it's Win32. Picture in usual format. E.g. copied from Windows Paint. How can one read this picture (from clipboard) and save it to a PNG or JPEG file? ---------------------------------------------------------------------- avk · 2021-02-05 16:44 Something like this? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...uses  ..., Clipbrd, ......procedure TForm1.Button1(Sender: TObject);begin  if ClipBoard.HasPictureFormat then    with TPicture.Create do      try        Assign(Clipboard);        SaveToFile('Picture.png');      finally        Free;      end;end; ---------------------------------------------------------------------- lucamar · 2021-02-05 16:48 Alternatively (cause avk's answer seems too simple ): All format-specific images descend from TGraphic so you can probably just create the proper graphic (TPortableNetworkGraphic or TJPEGImage) and use its LoadFromClipboardFormat(), it there is such a format in the clipboard. If that doesn't work (which is probable) just try the same trick with a compatible format (usually a TBitmap) or a TPicture. Note that TClipboard has several methods that might help you to "divine" which is the format of the image it contains: FindPictureFormatID, HasPictureFormat, etc. ---------------------------------------------------------------------- AlexTP · 2021-02-06 11:44 Thank you guys.