Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

WmfPlaceableFileHeader (gdi32)
 
.
Summary
Structure for Aldus Placeable Metafiles (used to prefix old-style Windows metafiles when storing them on disk)

C# Signature:

[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct WmfPlaceableFileHeader
{
     public uint key;  // 0x9aC6CDD7
     public ushort hmf;
     public ushort bboxLeft;
     public ushort bboxTop;
     public ushort bboxRight;
     public ushort bboxBottom;
     public ushort inch;
     public uint reserved;
     public ushort checksum;
}

VB Signature:

TODO

User-Defined Types:

None.

Alternative Managed API:

None. .Net cannot save metafiles.

Notes:

None.

Tips & Tricks:

None.

Sample Code:

MetafileHeader mfh = Metafile.GetMetafileHeader(emfh);
const ushorttwips_per_inch = 1440;
header.key = 0x9aC6CDD7;  // magic number
header.hmf = 0;
header.bboxLeft = 0;
header.bboxRight = width_in_inches * twips_per_inch;
header.bboxTop = 0;
header.bboxBottom = height_in_inches * twips_per_inch;
header.inch = twips_per_inch;
header.reserved = 0;

// Calculate checksum for first 10 WORDs.
ushort checksum = 0;
byte[] header_bytes = StructureToByteArray(header);
for (int i = 0; i < 10; i++)
     checksum ^= BitConverter.ToUInt16(header_bytes, i * 2);
header.checksum = checksum;

// Construct the file in-memory.
header_bytes = StructureToByteArray(header);
stream.Write(header_bytes, 0, header_bytes.Length);
stream.Write(metafile_bits, 0, metafile_bits.Length);

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions