Minigui学习--RECT

1.RECT

(1)定义:

在common.h文件中有如下定义:

typedef struct _RECT
{
    /**
     * The x coordinate of the upper-left corner of the rectangle.
     */
    int left;
    /**
     * The y coordinate of the upper-left corner of the rectangle.
     */
    int top;
    /**
     * The x coordinate of the lower-right corner of the rectangle.
     */
    int right;
    /**
     * The y coordinate of the lower-right corner of the rectangle.
     */
    int bottom;
} RECT;

typedef RECT* PRECT;

 

在minigui.h文件中有如下定义:

/**
 * \var RECT g_rcScr
 * \brief Contains the rectangle of the whole screen.
 */
extern MG_EXPORT RECT g_rcScr;

/**
 * \def g_rcDesktop
 * \brief Contains the rectangle of desktop of the application.
#define g_rcDesktop     g_rcScr

 

例如:

static RECT welcome_rc = {10, 100, 600, 400};

SetRect (&welcome_rc,  10, 10, g_rcScr.right - 10, g_rcScr.bottom / 2 - 10);

CreateInfo.lx = 0;
CreateInfo.ty = 0;
CreateInfo.rx = g_rcScr.right;
CreateInfo.by = g_rcScr.bottom;

 

(2)相关函数:

static inline void SetRect (RECT* prc, int left, int top, int right, int bottom); //sets the rectangle with specified values,note Defined as an inline function for _USE_NEWGAL

static inline void SetRectEmpty (RECT* prc); //This function will sets all coordinates of the rectangle to be zero, Defined as an inline function for _USE_NEWGAL.

static inline void OffsetRect (RECT* prc, int x, int y); //x must be a negative value to move the rectangle to the left, and  y must be a negative value to move the rectangle up,note Defined as an inline function for _USE_NEWGAL

 

2.POINT

(1)定义:

typedef struct _POINT
{
    /**
     * The x coordinate of the point.
     */
    int x;
    /**
     * The y coordinate of the point.
     */
    int y;
} POINT;

typedef POINT* PPOINT;

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值