program TestBmpClip;

{ Copr. 1995 Matthias K”ppe
}

{$G+,X+}

uses Crt, Graph, WinRes, Bitmap, Clipbrd, BmpClip;

var
  d, m: Integer;
  B: PBitmap;
  Image: pointer;

begin
  If not OpenClipboard
  then WriteLn('Can''t open the clipboard')
  else begin
    B := GetBitmapFromClip;
    If B = nil
    then WriteLn('There is no bitmap in the clipboard.')
    else begin
      Image := BitmapToImage(B);
      d := vga; m := vgahi;
      InitGraph(d, m, '\bp\bgi');
      PutImage(0, 0, Image^, NormalPut);
      ReadKey;
      CloseGraph
    end;
    CloseClipboard
  end
end.
