TNGMetafilePictFormat

<< Click to Display Table of Contents >>

Navigation:  Data Formats >

TNGMetafilePictFormat

Previous pageReturn to chapter overviewNext page

TNGMetafilePictFormat class implements standard CF_METAFILEPICT data format and allows to drag/receive old style Windows metafiles. NG Drag&Drop use TMetafile standard Delphi type for working with metafile data.

 

The class declares two methods: Data and Ref. Data method can be used to drag metafile data at the source side, while Ref method can be used to receive metafiles at the target side. NG Drag&Drop declares special type alias CF.METAFILEPICT to make user's code more readable:

 

NGDropSource.Add(CF.METAFILEPICT.Data(m))
            .Execute;
 
NGDropTarget.Register(MyTargetPanel, procedure(C: TNGTargetContext)
var
  m: TMetafile;
begin
  m := TMetafile.Create;
  try
    if C.Accept(CF.METAFILEPICT.Ref(m)) then
      ShowMetafile(m);
  finally
    m.Free;
  end;
end);