Board index » cppbuilder » Pasting Bitmap from clipboard

Pasting Bitmap from clipboard

The following section of code is located in the Help files with Borland C++
Builder 5 under Pasting graphics from the Clipboard.

I seem to be having a problem with the code.

{
  Graphics::TBitmap *Bitmap;
  if (Clipboard()->HasFormat(CF_BITMAP)){
    Image->Picture->Bitmap->Assign(Clipboard);
    Canvas->Draw(0, 0, Bitmap);
  }

Quote
}

The problem i am having is in htis section:
Image->Picture->Bitmap->Assign(Clipboard);
Here is where i am getting an error ----^

These are the errors:
[C++ Error] Unit2.cpp(47): E2034 Cannot convert 'TClipboard * (_fastcall
*)()' to 'TPersistent *'
[C++ Error] Unit2.cpp(47): E2342 Type mismatch in parameter 'Source' (wanted
'TPersistent *', got 'TClipboard * (_fastcall *)()')

Can someone please help.

Thanx in advance

p0_...@bellsouth.net

 

Re:Pasting Bitmap from clipboard


Quote
> The problem i am having is in htis section:
> Image->Picture->Bitmap->Assign(Clipboard);
> Here is where i am getting an error ----^

> These are the errors:
> [C++ Error] Unit2.cpp(47): E2034 Cannot convert 'TClipboard * (_fastcall
> *)()' to 'TPersistent *'
> [C++ Error] Unit2.cpp(47): E2342 Type mismatch in parameter 'Source' (wanted
> 'TPersistent *', got 'TClipboard * (_fastcall *)()')

there is a mistake right front of you.
Image->Picture->Bitmap->Assign(Clipboard());  // nead ()

 kaji yasuyuki
 yk...@cutspamusa.net  ;use without cutspam

Other Threads