边框

函数原型

 

函数名

px_void PX_GeoDrawBorder(px_surface *psurface, px_int left, px_int top, px_int rignt, px_int bottom ,px_int lineWidth,px_color color);

说明

绘制一个边框

参数

psurface 渲染表面

left top right bottom 位置描述

lineWidth 边框宽度像素

color 颜色

 

示范1

PX_ApplicationRender中添加代码(如下所示),分别绘制一个:

100,100--->  (300,300) 宽度为3 黑色 边框

px_void PX_ApplicationRender(PX_Application *pApp,px_dword elpased)

{

    px_surface *pRenderSurface=&pApp->runtime.RenderSurface;

    PX_RuntimeRenderClear(&pApp->runtime,PX_COLOR(255,255,255,255));

 

    PX_GeoDrawBorder(pRenderSurface,100,100,300,300,3,PX_COLOR(255,0,0,0));

}

 

示范2

PX_ApplicationRender中添加代码(如下所示),分别绘制一个:

100,100--->  (300,300) 宽度为8 红色 半透明 边框

200,200--->  (500,500) 宽度为8 蓝色 半透明 边框

px_void PX_ApplicationRender(PX_Application *pApp,px_dword elpased)

{

    px_surface *pRenderSurface=&pApp->runtime.RenderSurface;

    PX_RuntimeRenderClear(&pApp->runtime,PX_COLOR(255,255,255,255));

 

    PX_GeoDrawBorder(pRenderSurface,100,100,300,300,8,PX_COLOR(128,255,0,0));

    PX_GeoDrawBorder(pRenderSurface,200,200,500,500,8,PX_COLOR(128,0,0,255));

}