Vcl.Clipbrd.TClipboard.Assign

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Assign(Source: TPersistent); override;

C++

virtual void __fastcall Assign(System::Classes::TPersistent* Source);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Clipbrd.pas
Vcl.Clipbrd.hpp
Vcl.Clipbrd TClipboard

Description

Copies an object to the clipboard.

Use Assign to copy pictures to and from the clipboard. For example, the following code copies the bitmap from a TBitmap instance (Bitmap1) to the clipboard.



Clipboard.Assign(Bitmap1); {Delphi}



Clipboard()->Assign(Bitmap1); // C++



If a bitmap is on the clipboard, the following code copies it to Bitmap1.



Bitmap1.Assign(Clipboard); {Delphi}



Bitmap1->Assign(Clipboard()); // C++



The Formats property lists the formats used by the clipboard. Different kinds of graphic object (such as bitmaps and metafiles) have their own formats. Use the HasFormat method to determine whether the information on the clipboard is stored in a format compatible with the object you want to assign it to.

See Also

Code Examples