c++builder Delphi 直接使用剪贴板 Clipboard 剪贴板

delphi

use  Vcl.Clipbrd

procedure TForm27.FormCreate(Sender: TObject);
begin
  Caption := Clipboard.AsText;
end;

剪贴板

不用创建对象,直接使用剪贴板

#include <Vcl.Clipbrd.hpp>

Caption = Clipboard()->AsText;

Clipboard()->SetTextBuf(objname);

fmx剪贴板

https://community.embarcadero.com/blogs/entry/copy-and-paste

procedure TCopyPasteDemo.CopyButtonClick(Sender: TObject);
var
Svc: IFMXClipboardService;
Image: TBitmap;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, Svc) then
if TextRadioButton.IsChecked then
Svc.SetClipboard(Edit1.Text)
else
begin
Image := TextBorder.MakeScreenshot;
try
Svc.SetClipboard(Image);
finally
Image.Free;
end;
end;
end; procedure TCopyPasteDemo.PasteButtonClick(Sender: TObject);
var
Svc: IFMXClipboardService;
Value: TValue;
Bitmap: TBitmap;
begin
if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, Svc) then
begin
Value := Svc.GetClipboard;
if not Value.IsEmpty then
begin
if Value.IsType<string> then
begin
PasteLabel.Text := Value.ToString;
PasteImage.Bitmap := nil;
end
else if Value.IsType<TBitmapSurface> then
try
PasteLabel.Text := string.Empty;
Bitmap := TBitmap.Create;
try
Bitmap.Assign(Value.AsType<TBitmapSurface>);
PasteImage.Bitmap := Bitmap;
finally
Bitmap.Free;
end;
finally
Value.AsType<TBitmapSurface>.Free;
end;
end;
end;
end;

c++builder Delphi 直接使用剪贴板 Clipboard的更多相关文章

  1. linux与windows共享剪贴板(clipboard)

    linux与windows共享剪贴板(clipboard)的方法 先说两句废话,其实linux和windows之间不需要共享剪贴板,直接在putty中,按住SHIFT+鼠标选择就可以了. 但是作为一种 ...

  2. (转载)c++builder/delphi中透明panel及透明窗口的实现方法_delphi教程

    c++builder/delphi中透明panel及透明窗口的实现方法_delphi教程 可能大多数程序员会问:透明窗口,特别是透明Panel有什么应用价值呢?可别小看它们哦,下面我就来讲讲他们的巨大 ...

  3. win10 UWP 剪贴板 Clipboard

    win10 UWP 剪贴板 Clipboard使用Windows.ApplicationModel.DataTransfer.Clipboard 设置文本 DataPackage dataPackag ...

  4. Xamarin Essentials教程剪贴板Clipboard

    Xamarin Essentials教程剪贴板Clipboard   现在手机设备操作以触屏为主,不便于文本输入.虽然可以通过复制/粘贴的方式,借助系统剪贴板简化操作,但仍然不够方便.如果通过代码操作 ...

  5. UWP 剪贴板 Clipboard

    Clipboard使用Windows.ApplicationModel.DataTransfer.Clipboard 设置文本 DataPackage dataPackage = new DataPa ...

  6. c++builder delphi 调用dll dll编写

    c++builder动态调用dll // 定义 typedef int __stdcall MyFunction (int x, char *str); ; String dllName = &quo ...

  7. [React Native]访问操作系统剪贴板 Clipboard

    我们之前学习了TextInput组件, 有时候我们需要在TextInput组件中复制或者粘贴一些文字. React Native为开发者提供了 Clipboard API,Clipboard 组件可以 ...

  8. Salesforce LWC学习(二十八) 复制内容到系统剪贴板(clipboard)

    本篇参考: https://developer.mozilla.org/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipb ...

  9. html5: 复制到剪贴板 clipboard.js

    1.使用clipboard.min.js工具,引用此js 注意事项: IOS微信网页开发中,若使用此工具来开发复制功能,则需要在超链接/按钮上新增 onclick=" " 2.cl ...

随机推荐

  1. 12 Factor CLI Apps

    CLIs are a fantastic way to build products. Unlike web applications, they take a small fraction of t ...

  2. 整理开源协议问题 GPL APACHE

    整理开源协议问题 GPL APACHE APACHE 和 GPL 互相不兼容. APACHE 不可以使用 GPL 的代码. 但是 APACHE 可以调用 GPL 组件的接口. 比如 Linux 和 A ...

  3. js 坐标兼容性

    不同浏览器对坐标属性的支持:

  4. 后台取IE的相关信息

    HttpBrowserCapabilities b = Request.Browser; Response.Write("浏览器名称和版本号:" + b.Type + " ...

  5. java 物理资源回收 finally与try

    java垃圾回收机制不会回收任何物理资源(磁盘文件.数据库连接.网络连接),垃圾回收机制只能回收堆内存中对象所占用的内存. 方法一使用finally块,在finally块中写入资源回收代码,如下: p ...

  6. 转 JMeter之修改Sampler响应数据的编码格式

    问题:JMeter的sampler响应数据中有中文时,会解析出错. JMeter的Sampler中的响应数据默认的编码格式是:ISO-8859-1.来自文件: jmeter.properties中的语 ...

  7. ES(6): access elasticsearch via curl

    curl是一个非常实用的.用来与服务器之间传输数据的工具:支持的协议包括 (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, ...

  8. json格式字符串处理

    public class InternalClass         {             public int MID;             public string Name;     ...

  9. git: fatal: Could not read from remote repository

    This is probably an Intellij problem. Your key are managed natively by ssh, and Intellij has it's ow ...

  10. 中点Brehensam画线算法

    #include<stdio.h> #include<stdlib.h> #include"graphics.h" //函数声明 void MidBreha ...