Difference between revisions of "Clipboard"
From Lazarus wiki
Jump to navigationJump to searchLine 1: | Line 1: | ||
− | = | + | ==Predefined types== |
− | ==Load from clipboard== | + | {| style="wikitable sortable" |
+ | ! TPredefinedClipboardFormat !! MIME type | ||
+ | |- | ||
+ | | pcfText || text/plain | ||
+ | |- | ||
+ | | pcfBitmap || image/bmp | ||
+ | |- | ||
+ | | pcfPixmap || image/xpm | ||
+ | |- | ||
+ | | pcfIcon || image/lcl.icon | ||
+ | |- | ||
+ | | pcfPicture || image/lcl.picture | ||
+ | |- | ||
+ | | pcfObject || application/lcl.object | ||
+ | |- | ||
+ | | pcfComponent || application/lcl.component | ||
+ | |- | ||
+ | | pcfCustomData || application/lcl.customdata | ||
+ | |- | ||
+ | | pcfDelphiText || text/plain | ||
+ | |- | ||
+ | | pcfDelphiBitmap || text/delphi.bitmap | ||
+ | |- | ||
+ | | pcfDelphiPicture || Delphi picture | ||
+ | |- | ||
+ | | pcfDelphiMetaFilePict || image/delphimetafilepict | ||
+ | |- | ||
+ | | pcfDelphiObject || application/delphi.object | ||
+ | |- | ||
+ | | pcfDelphiComponent || Delphi component | ||
+ | |- | ||
+ | | pcfKylixPicture || image/delphi.picture | ||
+ | |- | ||
+ | | pcfKylixBitmap || image/delphi.bitmap | ||
+ | |- | ||
+ | | pcfKylixDrawing || image/delphi.drawing | ||
+ | |- | ||
+ | | pcfKylixComponent || application/delphi.component | ||
+ | |} | ||
+ | |||
+ | ==Text== | ||
+ | |||
+ | ==Image== | ||
+ | |||
+ | ===Load from clipboard=== | ||
<delphi>uses | <delphi>uses | ||
Line 14: | Line 58: | ||
end;</delphi> | end;</delphi> | ||
− | ==Save to clipboard== | + | ===Save to clipboard=== |
<delphi>uses | <delphi>uses |
Revision as of 13:19, 27 January 2012
Predefined types
TPredefinedClipboardFormat | MIME type |
---|---|
pcfText | text/plain |
pcfBitmap | image/bmp |
pcfPixmap | image/xpm |
pcfIcon | image/lcl.icon |
pcfPicture | image/lcl.picture |
pcfObject | application/lcl.object |
pcfComponent | application/lcl.component |
pcfCustomData | application/lcl.customdata |
pcfDelphiText | text/plain |
pcfDelphiBitmap | text/delphi.bitmap |
pcfDelphiPicture | Delphi picture |
pcfDelphiMetaFilePict | image/delphimetafilepict |
pcfDelphiObject | application/delphi.object |
pcfDelphiComponent | Delphi component |
pcfKylixPicture | image/delphi.picture |
pcfKylixBitmap | image/delphi.bitmap |
pcfKylixDrawing | image/delphi.drawing |
pcfKylixComponent | application/delphi.component |
Text
Image
Load from clipboard
<delphi>uses
Clipbrd, LCLIntf, LCLType, ...;
procedure LoadBitmapFromClipboard(Bitmap: TBitmap); begin
if Clipboard.HasFormat(PredefinedClipboardFormat(pcfDelphiBitmap)) then Bitmap.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfDelphiBitmap)); if Clipboard.HasFormat(PredefinedClipboardFormat(pcfBitmap)) then Bitmap.LoadFromClipboardFormat(PredefinedClipboardFormat(pcfBitmap));
end;</delphi>
Save to clipboard
<delphi>uses
Clipbrd, ...;
procedure SaveBitmapToClipboard(Bitmap: TBitmap); begin
Clipboard.Assign(Bitmap);
end;</delphi>