⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 meta.hpp

📁 WinCE5.0部分核心源码
💻 HPP
📖 第 1 页 / 共 5 页
字号:
        LONG     cySrc1,
        COLORREF clrBkSrc1,
        HBITMAP  hbitmap1
    )
    {
        cxSrc = cxSrc1;
        cySrc = cySrc1;

        return MRBB::bInit(
                emr,    // EMR_STRETCHBLT or EMR_TRANSPARENTIMAGE
                pmdc1,
                xDst1,
                yDst1,
                cxDst1,
                cyDst1,
                rop1,
                clrBkSrc1,
                hbitmap1);
    }

    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);

    void Cleanup() { MRBB::Cleanup(); };
};

typedef MRSTRETCHBLT *PMRSTRETCHBLT;
#define SIZEOF_MRSTRETCHBLT   sizeof(MRSTRETCHBLT)

/*********************************Class************************************\
* class MRMASKBLT : public MRBB
*
* MASKBLT record.
*
* History:
*  Wed Nov 27 12:00:33 1991     -by-    Hock San Lee    [hockl]
* Wrote it.
\**************************************************************************/

class MRMASKBLT : public MRBB   /* mrsb */
{
protected:
    LONG        xMask;          // mask x origin
    LONG        yMask;          // mask y origin
    DWORD       iUsageMask;     // color table usage in mask's bitmap info.
                                // This contains DIB_PAL_INDICES.
    HBITMAP     m_hbitmapMask;

public:
    //
    // Initializer -- Initialize the metafile record.
    //
    BOOL bInit(
        PMDC     pmdc1,
        LONG     xDst1,
        LONG     yDst1,
        LONG     cxDst1,
        LONG     cyDst1,
        DWORD    rop1,          // Really a rop3
        COLORREF clrBkSrc1,
        HBITMAP  hbitmapMask1,  // Optional
        LONG     xMask1,
        LONG     yMask1,
        HBITMAP  hbitmapSrc1    // Optional
    );

    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);

    void
	Cleanup(
		void
		);
};

typedef MRMASKBLT *PMRMASKBLT;
#define SIZEOF_MRMASKBLT     sizeof(MRMASKBLT)


/*********************************Class************************************\
* class MTEXT
*
* Base record for all textout metafile records.
*
* History:
*  Thu Aug 24 15:20:33 1992     -by-    Hock San Lee    [hockl]
* Wrote it.
\**************************************************************************/

class MTEXT
{
public:
    EPOINTL eptlRef;    // Logical coordinates of the reference point
    DWORD   cchString;  // Number of chars in the string.
    DWORD   offString;  // (Dword-aligned) offset to the string.
    DWORD   fOptions;   // Flags for rectangle usage.
    ERECTL  ercl;       // Opaque of clip rectangle if exists.
    DWORD   offaDx;     // (Dword-aligned) offset to the distance array.
                        // If the distance array does not exist, it
                        // will be queried and recorded!
public:
    //
    // Initializer -- Initialize the metafile record.
    //
    BOOL bInit
    (
        HDC        hdc1,
        int        x1,
        int        y1,
        UINT       fl1,
        CONST RECT *prc1,
        LPCSTR     pString1,
        int        cchString1,
        CONST INT *pdx1,
        PMR        pMR1,
        DWORD      offString1,          // dword-aligned aDx follows the string
        int        cjCh1                // size of a character in bytes
    );
};

/*********************************Class************************************\
* class MREXTTEXTOUT
*
* Metafile record for TextOutW and ExtTextOutW.
*
* History:
*  Thu Aug 24 15:20:33 1992     -by-    Hock San Lee    [hockl]
* Wrote it.
\**************************************************************************/

class MREXTTEXTOUT : public MR          /* mreto */
{
protected:
    MTEXT       mtext;          // Base record for textout.

public:
    //
    // Initializer -- Initialize the metafile record.
    //
    BOOL bInit
    (
        DWORD      iType1,
        PMDC       pmdc1,
        HDC        hdc1,
        int        x1,
        int        y1,
        UINT       fl1,
        CONST RECT *prc1,
        LPCSTR     pString1,
        int        cchString1,
        CONST INT *pdx1,
        int        cjCh1                // size of a character in bytes
    )
    {
        ASSERT(iType1 == EMR_EXTTEXTOUTW);

        MR::vInit(iType1);

        return
        (
            mtext.bInit
            (
                hdc1,
                x1,
                y1,
                fl1,
                prc1,
                pString1,
                cchString1,
                pdx1,
                this,                           // pMR
                sizeof(MREXTTEXTOUT),           // offString
                cjCh1
            )
        );
    }

    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MREXTTEXTOUT *PMREXTTEXTOUT;

#define SIZEOF_MREXTTEXTOUT(cchString, cjCh)                    \
        ((sizeof(MREXTTEXTOUT)                                  \
         +(cchString)*((cjCh)+sizeof(LONG))                     \
         +3) / 4 * 4)

class MRPOLYGON : public MRBP           /* mrpg */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRPOLYGON *PMRPOLYGON;

class MRPOLYLINE : public MRBP          /* mrpl */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRPOLYLINE *PMRPOLYLINE;

class MRSETVIEWPORTORGEX : public MRDD  /* mrsvoe */
{
public:

// bPlay -- Play the record.

    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETVIEWPORTORGEX *PMRSETVIEWPORTORGEX;

class MRSETBRUSHORGEX : public MRDD     /* mrsboe */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETBRUSHORGEX *PMRSETBRUSHORGEX;

class MRSETBKMODE : public MRD          /* mrsbm */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETBKMODE *PMRSETBKMODE;

class MRSETROP2 : public MRD            /* mrsr2 */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETROP2 *PMRSETROP2;

class MRSETTEXTCOLOR : public MRD       /* mrstc */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETTEXTCOLOR *PMRSETTEXTCOLOR;

class MRSETBKCOLOR : public MRD         /* mrsbc */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETBKCOLOR *PMRSETBKCOLOR;

class MRSETLAYOUT : public MRD
{
public:
    //
    // bPlay -- Play the record.
    //
    DWORD bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETLAYOUT *PMRSETLAYOUT;

class MRSETTEXTALIGN : public MRD
{
public:
	BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETTEXTALIGN *PMRSETTEXTALIGN;

class MRSETTEXTCHARACTEREXTRA : public MRD
{
public:
	BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSETTEXTCHARACTEREXTRA *PMRSETTEXTCHARACTEREXTRA;

class MREXCLUDECLIPRECT : public MRDDDD /* mrecr */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MREXCLUDECLIPRECT *PMREXCLUDECLIPRECT;

class MRINTERSECTCLIPRECT : public MRDDDD       /* mricr */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRINTERSECTCLIPRECT *PMRINTERSECTCLIPRECT;

class MRSAVEDC : public MR              /* mrsdc */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSAVEDC *PMRSAVEDC;

class MRRESTOREDC : public MRD          /* mrrdc */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRRESTOREDC *PMRRESTOREDC;


class MRSELECTPALETTE : public MRD      /* mrsp */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSELECTPALETTE *PMRSELECTPALETTE;

class MRREALIZEPALETTE : public MR      /* mrrp */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRREALIZEPALETTE *PMRREALIZEPALETTE;

class MRSELECTOBJECT : public MRD       /* mrso */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRSELECTOBJECT *PMRSELECTOBJECT;

class MRDELETEOBJECT : public MRD       /* mrdo */
{
public:
    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRDELETEOBJECT *PMRDELETEOBJECT;

class MRRESETDC : public MR         /* mrescape */
{
private:
   DWORD cjDevMode;

public:
    //
    // Initializer -- Initialize the metafile record.
    //
    VOID vInit
    (
        DWORD        iType1,
        DEVMODEW     *pDevMode
    )
    {
        MR::vInit(iType1);
        cjDevMode = pDevMode->dmSize + pDevMode->dmDriverExtra;
        memcpy((PBYTE)this + sizeof(MRRESETDC), (PBYTE) pDevMode, cjDevMode);
    }

    //
    // bPlay -- Play the record.
    //
    BOOL bPlay(HDC hdc, PHANDLETABLE pht, UINT cht);
};

typedef MRRESETDC *PMRRESETDC;


/*********************************Class************************************\
* class MRBDIB : public MRB
*
* Metafile record with Bounds and Dib.
*
* History:
*  Wed Nov 27 12:00:33 1991     -by-    Hock San Lee    [hockl]
* Wrote it.
\**************************************************************************/

class MRBDIB : public MR        /* mrsdb */
{
protected:
    LONG        xDst;           // destination x origin
    LONG        yDst;           // destination y origin
    LONG        xDib;           // dib x origin
    LONG        yDib;           // dib y origin
    LONG        cxDib;          // dib width
    LONG        cyDib;          // dib height
    DWORD       offBitsInfoDib; // offset to dib info, we don't store core info.
    DWORD       cbBitsInfoDib;  // size of dib info
    DWORD       offBitsDib;     // offset to dib bits
    DWORD       cbBitsDib;      // size of dib bits buffer
    DWORD       iUsageDib;      // color table usage in bitmap info.

public:
// Initializer -- Initialize the metafile record.

    VOID vInit
    (
        DWORD iType1,
        PMDC  pmdc1,
        LONG  xDst1,
        LONG  yDst1,
        LONG  xDib1,
        LONG  yDib1,
        LONG  cxDib1,
        LONG  cyDib1,
        DWORD offBitsInfoDib1,
        DWORD cbBitsInfoDib1,
        CONST BITMAPINFO *pBitsInfoDib1,
        DWORD offBitsDib1,
        DWORD cbBitsDib1,
        CONST VOID * pBitsDib1,
        DWORD iUsageDib1,
        DWORD cbProfData1 = 0,         // Only used with BITMAPV5
        CONST VOID * pProfData1 = NULL // Only used with BITMAPV5
    )
    {
      
        // cbBitsInfoDib1 and cbBitsDib1 may not be dword sized!

        ASSERT(offBitsDib1 % 4 == 0);
        ASSERT(offBitsInfoDib1 % 4 == 0);

        // +---------------------+ <--- offBitsInfoDib1
        // | Bitmap Info header  |   |
        // +- - - - - - - - - - -+   +- cbBitsInfoDib1
        // | Color Table         |   |
        // +- - - - - - - - - - -+  ---
        // |                     |   |
        // | Color Profile Data  |   +- cbProfData1
        // |   (BITMAPV5 only)   |   |
        // +---------------------+ <--- offBitsDib1
        // |                     |   |
        // | Bitmap Bits         |   +- cbBitsDib1
        // |                     |   |
        // +---------------------+  ---

        MR::vInit(iType1);
        xDst            = xDst1;
        yDst            = yDst1;
        xDib            = xDib1;
        yDib            = yDib1;
        cxDib           = cxDib1;
        cyDib           = cyDib1;
        offBitsInfoDib  = offBitsInfoDib1;
        cbBitsInfoDib   = cbBitsInfoDib1 + cbProfData1;
        offBitsDib      = offBitsDib1;
        cbBitsDib       = cbBitsDib1;
        iUsageDib       = iUsageDib1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -