Playing a Metafile

The following figure shows an example of how to play the metafile using the font, color table, and fill-pattern descriptions in your application's presentation space.

#define INCL_GPIMETAFILES
#include <os2.h>
void fncMETA04(void){
    HPS hps;
    HMF hmf;
    LONG alOpt[10];

    alOpt[PMF_SEGBASE]  = 0;               /* Reserved                        */
    alOpt[PMF_LOADTYPE] = LT_DEFAULT;      /* Viewing transformation in PS    */
    alOpt[PMF_RESOLVE]  = RS_DEFAULT;      /* Reserved                        */
    alOpt[PMF_LCIDS]    = LC_DEFAULT;      /* Font and fill pattern in PS     */
    alOpt[PMF_RESET]    = RES_DEFAULT;     /* Page units and dimensions in PS */
    alOpt[PMF_SUPPRESS] = SUP_DEFAULT;     /* Draws metafile into PS          */
    alOpt[PMF_COLORTABLES]     = CTAB_DEFAULT;    /* Color table in PS        */
    alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;    /* Sets realizable option   */

    GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
} /* fncMETA04 */

The following figure shows an example of how to play a metafile using the font, color table, and fill-pattern descriptions in the metafile.

#define INCL_GPIMETAFILES
#include <os2.h>
void fncMETA05(void){
    HPS hps;
    HMF hmf;
    LONG alOpt[10];

    alOpt[PMF_SEGBASE]  = 0;             /* Reserved                          */
    alOpt[PMF_LOADTYPE] = LT_DEFAULT;    /* Viewing transformation in PS      */
    alOpt[PMF_RESOLVE]  = RS_DEFAULT;    /* Reserved                          */
    alOpt[PMF_LCIDS]    = LC_LOADDISC;   /* Font and fill pattern in metafile */
    alOpt[PMF_RESET]    = RES_DEFAULT;   /* Page units and dimensions in PS   */
    alOpt[PMF_SUPPRESS] = SUP_DEFAULT;   /* Draws metafile into PS            */
    alOpt[PMF_COLORTABLES]     = CTAB_REPLACE;    /* Color table in metafile  */
    alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;    /* Sets realizable option   */

    GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
} /* fncMETA05 */

The following figure shows an example of how to play a metafile using the viewing transformation, page units, and presentation-page dimensions specified in the metafile.

#define INCL_GPIMETAFILES
#include <os2.h>
void fncMETA06(void){
    HPS hps;
    HMF hmf;
    LONG alOpt[10];

    alOpt[PMF_SEGBASE]  = 0;                    /* Reserved                    */
    alOpt[PMF_LOADTYPE] = LT_ORIGINALVIEW;      /* Viewing transformation      */
    alOpt[PMF_RESOLVE]  = RS_DEFAULT;           /* Reserved                    */
    alOpt[PMF_LCIDS]    = LC_DEFAULT;           /* Font and fill pattern in PS */
    alOpt[PMF_RESET]    = RES_RESET;            /* Page units/dimensions       */
    alOpt[PMF_SUPPRESS] = SUP_DEFAULT;          /* Draws metafile into PS      */
    alOpt[PMF_COLORTABLES]     = CTAB_DEFAULT;  /* Uses color table in PS      */
    alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;  /* Sets realizable option      */

    GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
} /* fncMETA06 */


[Back: Copying a Metafile to Disk]
[Next: Print Job Submission and Manipulation]