graphic.c

来自「好记星的控件,包括button,list,对文件操作」· C语言 代码 · 共 1,483 行 · 第 1/5 页

C
1,483
字号
{
	return g_dcSystemDC.dcBrush.bsColor;
}
UINT16			GraphGetBrushStyle(VOID)
{
	return g_dcSystemDC.dcBrush.bsStyle;
}
UINT16			GraphSetBrushStyle(UINT16 wBrushStyle)
{
	UINT16	wOldBrushStyle;
	wOldBrushStyle= g_dcSystemDC.dcBrush.bsStyle;
	g_dcSystemDC.dcBrush.bsStyle = wBrushStyle;
	return  wOldBrushStyle;
}
UINT32			GraphGetBrushHatchStyle(VOID)
{
	return g_dcSystemDC.dcBrush.bsHatch;
	
}
UINT32			GraphSetBrushHatchStyle(UINT32 wBrushHatchStyle)
{
	UINT32	wOldBrushHatchStyle;
	wOldBrushHatchStyle= g_dcSystemDC.dcBrush.bsHatch;
	g_dcSystemDC.dcBrush.bsHatch = wBrushHatchStyle;
	return  wOldBrushHatchStyle;
}


/****************************************************************************/
/* FUNCTION:   GraphGetBrush                                              */
/* DESCRIPTION:Get Brush for destine  DC.                                  */
/* INPUTS:     ,destion DC pointer.                                     */
/*              pBrush,destine Brush pointer to output Brush information.   */
/* OUTPUTS:    NONE                                                        */
/* RETURN:     NONE                                                        */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
VOID GraphGetBrush(MBrush* pBrush)
{
    if (!pBrush)                                                    //Check if the brush buffer is valid
    {
        return;
    }
    memmove((UINT8*)pBrush,(UINT8*)&(g_dcSystemDC.dcBrush),sizeof(MBrush)); //Copy brush information to destine buffer
}
*/
/****************************************************************************/
/* FUNCTION:   GraphSetBKColor                                            */
/* DESCRIPTION:Reset background color of destine  DC.                      */
/* INPUTS:     ,destion DC pointer.                                     */
/*              dwColor,new color value.                                    */
/* OUTPUTS:    preThis                                                     */
/* RETURN:     The old value.                                              */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/

UINT32  GraphSetBKColor(UINT32 dwColor)
{
    UINT32 dwOldColor;


    dwOldColor = g_dcSystemDC.dcBKColor;        //Backup old value
    if (_IsSystemColor(dwColor & 0xffffff)) {
        g_dcSystemDC.dcBKColor = dwColor & 0xffffff;
    }

    return dwOldColor;                  //Return old value
}

/****************************************************************************/
/* FUNCTION:   GraphGetBKColor                                            */
/* DESCRIPTION:Get background color of destine  DC.                        */
/* INPUTS:     ,destion DC pointer.                                     */
/* OUTPUTS:    g_dcSystemDC.dcBKColor                                              */
/* RETURN:     g_dcSystemDC.dcBKColor                                              */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
UINT32  GraphGetBKColor(VOID)
{
    return  g_dcSystemDC.dcBKColor;                                         //Return background color
}

/****************************************************************************/
/* FUNCTION:   GraphSetTextColor                                          */
/* DESCRIPTION:Reset text color of destine  DC.                            */
/* INPUTS:     ,destion DC pointer.                                     */
/*              dwColor,new color value.                                    */
/* OUTPUTS:    preThis                                                     */
/* RETURN:     The old value.                                              */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
UINT32  GraphSetTextColor(UINT32 dwColor)
{
    UINT32 dwOldColor;
    dwOldColor = g_dcSystemDC.dcTextColor;          //Backup old value
    if (_IsSystemColor(dwColor & 0xffffff)) {
        g_dcSystemDC.dcTextColor = dwColor & 0xffffff;
    }

    return dwOldColor;                      //Return old value
}

/****************************************************************************/
/* FUNCTION:   GraphGetTextColor                                          */
/* DESCRIPTION:Get text color of destine  DC.                              */
/* INPUTS:     ,destion DC pointer.                                     */
/* OUTPUTS:    g_dcSystemDC.dcTextColor                                            */
/* RETURN:     g_dcSystemDC.dcTextColor                                            */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
UINT32  GraphGetTextColor(VOID)
{
    return  g_dcSystemDC.dcTextColor;                                       /*Return text color*/
}

/****************************************************************************/
/* FUNCTION:   GraphSetDrawMode                                           */
/* DESCRIPTION:Reset draw mode  of destine  DC.                            */
/* INPUTS:     ,destion DC pointer.                                     */
/*              wDrawMode,new draw mode .                                   */
/* OUTPUTS:    preThis                                                     */
/* RETURN:     The old value.                                              */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
UINT8 GraphSetDrawMode(UINT8 wDrawMode)
{
    UINT8 preThis;
    preThis = g_dcSystemDC.dcDrawMode;                                      /*Backup the old draw mode*/
    g_dcSystemDC.dcDrawMode = wDrawMode;                                    /*Take the new draw mode*/
    return preThis;                                                 /*Return the old draw mode*/
}

/****************************************************************************/
/* FUNCTION:   GraphGetDrawMode                                           */
/* DESCRIPTION:Get draw mode  of destine  DC.                              */
/* INPUTS:     ,destion DC pointer.                                     */
/* OUTPUTS:    g_dcSystemDC.dcDrawMode                                             */
/* RETURN:     g_dcSystemDC.dcDrawMode                                             */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
UINT8 GraphGetDrawMode(VOID)
{
    return  g_dcSystemDC.dcDrawMode;                                        /*Return the draw mode of destine */
}

/****************************************************************************/
/* FUNCTION:   GraphSetFontLibID                                          */
/* DESCRIPTION:Reset font ID  of destine  DC.                              */
/* INPUTS:     ,destion DC pointer.                                     */
/*              uFontLibID,new font ID .                                    */
/* OUTPUTS:    preThis                                                     */
/* RETURN:     The old value.                                              */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
UINT16 GraphSetFontLibID(UINT16 uFontLibID)
{
    UINT16 preThis;    
 
    preThis = g_dcSystemDC.dcFontID;
    g_dcSystemDC.dcFontID = uFontLibID;    
    return preThis;                 //Return the pristine font
}
*/
/****************************************************************************/
/* FUNCTION:   GraphGetFontLibID                                          */
/* DESCRIPTION:Get font ID  of destine  DC.                                */
/* INPUTS:     ,destion DC pointer.                                     */
/* OUTPUTS:    g_dcSystemDC.dcFontID                                               */
/* RETURN:     g_dcSystemDC.dcFontID                                               */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
UINT16 GraphGetFontLibID(VOID)
{
    return  g_dcSystemDC.dcFontID;                                          //Return the fond id
}
*/

/****************************************************************************/
/* FUNCTION:   GraphSetDCOrig                                             */
/* DESCRIPTION:Reset up-left corner of destine  DC.                        */
/* INPUTS:     ,destion DC pointer.                                     */
/*              x,X-coordinate.                                             */
/*              y,Y-coordinate.                                             */
/* OUTPUTS:    NONE                                                        */
/* RETURN:     NONE                                                        */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*ID GraphSetDCOrig(INT x,INT y)
{
    g_dcSystemDC.dcX = x;                                                   //Adapt the new coordinates
    g_dcSystemDC.dcY = y;
}
*/
/****************************************************************************/
/* FUNCTION:   GraphGetDCOrig                                             */
/* DESCRIPTION:Get up-left corner destine  DC and fill the x and y buffer. */
/* INPUTS:     ,destion DC pointer.                                     */
/*              x,X-coordinate destine buffer.                              */
/*              y,Y-coordinate destine buffer.                                              */
/* OUTPUTS:    NONE                                                        */
/* RETURN:     NONE                                                        */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
VOID GraphGetDCOrig(INT *x,INT *y)
{
    if (x)
    {
        *x = g_dcSystemDC.dcX;                                              //Get X-coordinate
    }
    if (y)
    {
        *y = g_dcSystemDC.dcY;                                              //Get Y-coordinate
    }
}
*/
/****************************************************************************/
/* FUNCTION:   GraphSetBitMapInfo                                         */
/* DESCRIPTION:Reset bitmap information buffer  of destine  DC.            */
/* INPUTS:     ,destion DC pointer.                                     */
/*              pBitMapInfo,new bitmap information buffer.                  */
/* OUTPUTS:    preThis                                                     */
/* RETURN:     The old bitmap information buffer.                          */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
MBitMapInfo *GraphSetBitMapInfo(MBitMapInfo *pBitMapInfo)
{
    MBitMapInfo *preThis;
    
	preThis = g_dcSystemDC.dcBitMapInfo;                                    //Backup the pristine Bitmap information  
    g_dcSystemDC.dcBitMapInfo = pBitMapInfo;                                //Adapt the new Bitmap information  
    return preThis;                                                 //Return the new Bitmap information  
}
*/
/****************************************************************************/
/* FUNCTION:   GraphGetBitMapInfo                                         */
/* DESCRIPTION:Get bitmap information buffer  of destine  DC.              */
/* INPUTS:     ,destion DC pointer.                                     */
/* OUTPUTS:    g_dcSystemDC.dcBitMapInfo.                                          */
/* RETURN:     g_dcSystemDC.dcBitMapInfo.                                          */
/****************************************************************************/
/*  NAME           DATE               REMARKS                               */
/* ==========  ============   ==============================================*/
/*  Qorse       2002-08-11     build                                        */
/****************************************************************************/
/*
MBitMapInfo *GraphGetBitMapInfo(VOID)
{
    return g_dcSystemDC.dcBitMapInfo;                                      //Return the new Bitmap information
}
*/
/*
typedef struct PCXHead
{
   INT8		manufacturer;		//PCX文件的标识,必须为0x0a
   INT8		version;			
   INT8		encoding;

⌨️ 快捷键说明

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