Results 1 to 4 of 4

Thread: GetEnhMetaFileHeader

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    iran
    Posts
    37

    Unhappy GetEnhMetaFileHeader

    SOS:
    Does anybody know how can I use this api

    Function GetEnhMetaFileHeader Lib "gdi32" Alias "GetEnhMetaFileHeader" (ByVal hemf As Long, ByVal cbBuffer As Long, lpemh As ENHMETAHEADER) As Long

    I would be very grateful if so. Thanks.

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Here is some info
    GetEnhMetaFileHeader
    The GetEnhMetaFileHeader function retrieves the record containing the header for the specified enhanced-format metafile.

    UINT GetEnhMetaFileHeader(
    HENHMETAFILE hemf, // handle to enhanced metafile
    UINT cbBuffer, // size of buffer, in bytes
    LPENHMETAHEADER lpemh // pointer to the buffer to receive data
    );

    Parameters
    hemf
    Handle to the enhanced metafile for which the header is to be retrieved.
    cbBuffer
    Specifies the size, in bytes, of the buffer to receive the data. Only this many bytes will be copied.
    lpemh
    Pointer to an ENHMETAHEADER structure to receive the header record. If this parameter is NULL, the function returns the size of the header record.
    Return Values
    If the function succeeds and the structure pointer is NULL, the return value is the size of the record that contains the header; if the structure pointer is a valid pointer, the return value is the number of bytes copied. Otherwise, it is zero.

    Windows NT: To get extended error information, callGetLastError.

    Remarks
    An enhanced-metafile header contains such information as the metafile's size, in bytes; the dimensions of the picture stored in the metafile; the number of records stored in the metafile; the offset to the optional text description; the size of the optional palette, and the resolution of the device on which the picture was created.

    The record that contains the enhanced-metafile header is always the first record in the metafile.

    Windows 95 and Windows 98: The maximum length of the description string for an enhanced metafile is 16,384 bytes.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    And here is the structure info
    ENHMETAHEADER
    The ENHMETAHEADER structure contains enhanced-metafile data such as the dimensions of the picture stored in the enhanced metafile, the count of records in the enhanced metafile, the resolution of the device on which the picture was created, and so on.

    This structure is always the first record in an enhanced metafile.

    typedef struct tagENHMETAHEADER { // enmh
    DWORD iType;
    DWORD nSize;
    RECTL rclBounds;
    RECTL rclFrame;
    DWORD dSignature;
    DWORD nVersion;
    DWORD nBytes;
    DWORD nRecords;
    WORD nHandles;
    WORD sReserved;
    DWORD nDescription;
    DWORD offDescription;
    DWORD nPalEntries;
    SIZEL szlDevice;
    SIZEL szlMillimeters;
    DWORD cbPixelFormat;
    DWORD offPixelFormat;
    DWORD bOpenGL;
    } ENHMETAHEADER;

    Members
    iType
    Specifies the record type. This member must specify the value assigned to the EMR_HEADER constant.
    nSize
    Specifies the structure size, in bytes.
    rclBounds
    Specifies the dimensions, in device units, of the smallest rectangle that can be drawn around the picture stored in the metafile. This rectangle is supplied by graphics device interface (GDI). Its dimensions include the right and bottom edges.
    rclFrame
    Specifies the dimensions, in .01 millimeter units, of a rectangle that surrounds the picture stored in the metafile. This rectangle must be supplied by the application that creates the metafile. Its dimensions include the right and bottom edges.
    dSignature
    Specifies a doubleword signature. This member must specify the value assigned to the ENHMETA_SIGNATURE constant.
    nVersion
    Specifies the metafile version. The current version value is 0x10000.
    nBytes
    Specifies the size of the enhanced metafile, in bytes.
    nRecords
    Specifies the number of records in the enhanced metafile.
    nHandles
    Specifies the number of handles in the enhanced-metafile handle table. (Index zero in this table is reserved.)
    sReserved
    Reserved; must be zero.
    nDescription
    Specifies the number of characters in the array that contains the description of the enhanced metafile's contents. This member should be set to zero if the enhanced metafile does not contain a description string.
    offDescription
    Specifies the offset from the beginning of the ENHMETAHEADER structure to the array that contains the description of the enhanced metafile's contents. This member should be set to zero if the enhanced metafile does not contain a description string.
    nPalEntries
    Specifies the number of entries in the enhanced metafile's palette.
    szlDevice
    Specifies the resolution of the reference device, in pixels.
    szlMillimeters
    Specifies the resolution of the reference device, in millimeters.
    cbPixelFormat
    Specifies the size of the last recorded pixel format in a metafile. If a pixel format is set in a reference DC at the start of recording, cbPixelFormat is set to the size of the PIXELFORMATDESCRIPTOR. When no pixel format is set when a metafile is recorded, this member is set to zero. If more than a single pixel format is set, the header points to the last pixel format.
    offPixelFormat
    Specifies the offset of pixel format used when recording a metafile. If a pixel format is set in a reference DC at the start of recording or during recording, offPixelFormat is set to the offset of the PIXELFORMATDESCRIPTOR in the metafile. When no pixel format is set when a metafile is recorded, this member is set to zero. If more than a single pixel format is set, the header points to the last pixel format.
    bOpenGL
    Specifies whether any OpenGL records are present in a metafile. bOpenGL is a simple Boolean flag that you can use to determine whether an enhanced metafile requires OpenGL handling. When a metafile contains OpenGL records, bOpenGL is TRUE; otherwise it is FALSE.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    iran
    Posts
    37

    So How can I use it?

    So How can I use this all things in my vb program to change and unchange the file header via my program?

    thank you all.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width