【D3D】Direct3D中LPRECT(上左右底)和LPoint(x,y)之前转换

D3DSprite.cpp
void CD3DSprite::DrawText(CD3DFont *pFont, char *szString, RECT &DesRect, D3DCOLOR Color)
{
    DrawText(pFont, szString, DesRect, DT_TOP|DT_LEFT, Color);
}

void CD3DSprite::DrawText(CD3DFont *pFont, char *szString, D3DXVECTOR2 &Pos, D3DCOLOR Color)
{
    RECT DesRect;
    DesRect.left = Pos.x;
    DesRect.top = Pos.y;
    DesRect.right = pFont->GetFontArea().right;
    DesRect.bottom = pFont->GetFontArea().bottom;
    DrawText(pFont, szString, DesRect, Color);
}

void CD3DSprite::DrawText(CD3DFont* pFont, char *szString, RECT &DesRect, DWORD AlignFormat, D3DCOLOR Color)
{
    pFont->GetFontHandle()->DrawText(m_pSprite, szString, -1, &DesRect, AlignFormat, Color);
}

 

转载于:https://www.cnblogs.com/x-poior/p/4964157.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值