wxMetaFile::SetClipboard

Bool SetClipboard(int width = 0, int height = 0)

Passes the metafile data to the clipboard. The metafile can no longer be used for anything, but the wxMetaFile object must still be destroyed by the application.

Below is a example of metafle, metafile device context and clipboard use from the hello.cc example. Note the way the metafile dimensions are passed to the clipboard, making use of the device context's ability to keep track of the maximum extent of drawing commands.

  wxMetaFileDC dc;
  if (dc.Ok())
  {
    Draw(dc, FALSE);
    wxMetaFile *mf = dc.Close();
    if (mf)
    {
      Bool success = mf->SetClipboard((int)(dc.MaxX() + 10), (int)(dc.MaxY() + 10));
      delete mf;
    }
  }