Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Paste from clipboard in Firemonkey XE8


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Feb 12, 2017 9:01 AM Last Post By: Eli M
Andre Coetzer

Posts: 10
Registered: 6/1/08
Paste from clipboard in Firemonkey XE8  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2017 12:41 AM
I am trying to paste an image from the clipboard in Firemonkey XE8. I suspect this is simply a user problem, but I can't seem to access the clipboard. I have tried the following code, based on the following advice (http://codeverge.com/embarcadero.delphi.firemonkey/xe7-clipboard-copy-and-paste-te/2020910):

var
  Value: TValue;
  Clipboard: IFMXClipboardService;
 
  if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService,IInterface(Clipboard)) then
  begin
    //Value := TValue.From<*TypeHere*>(*DataHere*);  
    Value := TValue.From<TBitmap>(*DataHere*);
    //Value := Clipboard.GetClipboard;
    Clipboard.SetClipboard(Value);
  end;


I am not sure what the "TypeHere" and "DataHere" text requires. I assumed the type should be TBitmap or TImage, but this doesn't work. Some sources explain the type as a TBitmapSurface, but I can't find this type or compile the code.

I can't find an example of CopyPaste for Delphi XE8, and I think things have changed in Berlin. The Berlin demo I have compiles but doesn't work in XE8.

Any advice or code that will help is greatly appreciated!
Eli M

Posts: 1,346
Registered: 11/9/13
Re: Paste from clipboard in Firemonkey XE8  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2017 9:01 AM   in response to: Andre Coetzer in response to: Andre Coetzer
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02