Cannot assign TBitmapOfItem to TClipBoard?

  

I need to crop pdf and create word document of that cropped png image by pasting that in word document.

I am using Firemonkey Platform

this is code :

procedure TForm2.Button1Click(Sender: TObject);
begin
ShellExecute(FormToHWND(Self),’open’,PChar(GetCurrentDir+’\cairo.exe’)
,PWideChar(‘-opw ‘+Edit1.Text+
‘ -cropbox -png -x 64 -y 215 -W 144 -H 375 -r 167 ‘+
PdfFile+’ tools/card’),”,SW_Hide);
Sleep(500);
Image1.Bitmap.LoadFromFile(Output);
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
ClipBoard.Assign(Image1.Bitmap);
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
Output:= GetCurrentDir+’\tools\card-1.png’;
end;

Clicking on button2 pops the error Cannot assign TBitmapOfItem to TClipBoard.

How to copy the image to clipboard and create word document (don’t know much about it) ?

Comments are closed.