本文整理汇总了C++中LiceColor函数的典型用法代码示例。如果您正苦于以下问题:C++ LiceColor函数的具体用法?C++ LiceColor怎么用?C++ LiceColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LiceColor函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LiceColor
bool IGraphics::DrawArc(const IColor* pColor, float cx, float cy, float r, float minAngle, float maxAngle,
const IChannelBlend* pBlend, bool antiAlias)
{
_LICE::LICE_Arc(mDrawBitmap, cx, cy, r, minAngle, maxAngle, LiceColor(pColor),
LiceWeight(pBlend), LiceBlendMode(pBlend), antiAlias);
return true;
}
示例2: CacheFont
bool IGraphics::DrawIText(IText* pTxt, char* str, IRECT* pR)
{
if (!str || str[0] == '\0') {
return true;
}
LICE_IFont* font = pTxt->mCached;
if (!font)
{
font = CacheFont(pTxt);
if (!font) return false;
}
LICE_pixel color = LiceColor(&pTxt->mColor);
font->SetTextColor(color);
UINT fmt = DT_NOCLIP;
if (LICE_GETA(color) < 255) fmt |= LICE_DT_USEFGALPHA;
if (pTxt->mAlign == IText::kAlignNear)
fmt |= DT_LEFT;
else if (pTxt->mAlign == IText::kAlignCenter)
fmt |= DT_CENTER;
else // if (pTxt->mAlign == IText::kAlignFar)
fmt |= DT_RIGHT;
RECT R = { pR->L, pR->T, pR->R, pR->B };
font->DrawText(mDrawBitmap, str, -1, &R, fmt);
return true;
}
示例3: ForcePixel
bool IGraphics::ForcePixel(const IColor* pColor, int x, int y)
{
LICE_pixel* px = mDrawBitmap->getBits();
px += x + y * mDrawBitmap->getRowSpan();
*px = LiceColor(pColor);
return true;
}
示例4: int
bool IGraphics::DrawPoint(const IColor* pColor, float x, float y,
const IChannelBlend* pBlend, bool antiAlias)
{
float weight = (pBlend ? pBlend->mWeight : 1.0f);
_LICE::LICE_PutPixel(mDrawBitmap, int(x + 0.5f), int(y + 0.5f), LiceColor(pColor), weight, LiceBlendMode(pBlend));
return true;
}
示例5: CacheFont
bool IGraphics::DrawIText(IText* pTxt, char* str, IRECT* pR, bool measure)
{
if (!str || str[0] == '\0')
{
return true;
}
LICE_IFont* font = pTxt->mCached;
if (!font)
{
font = CacheFont(pTxt);
if (!font) return false;
}
LICE_pixel color = LiceColor(&pTxt->mColor);
font->SetTextColor(color);
UINT fmt = DT_NOCLIP;
if (LICE_GETA(color) < 255) fmt |= LICE_DT_USEFGALPHA;
if (pTxt->mAlign == IText::kAlignNear)
fmt |= DT_LEFT;
else if (pTxt->mAlign == IText::kAlignCenter)
fmt |= DT_CENTER;
else // if (pTxt->mAlign == IText::kAlignFar)
fmt |= DT_RIGHT;
if (measure)
{
fmt |= DT_CALCRECT;
RECT R = {0,0,0,0};
font->DrawText(mDrawBitmap, str, -1, &R, fmt);
if( pTxt->mAlign == IText::kAlignNear)
{
pR->R = R.right;
}
else if (pTxt->mAlign == IText::kAlignCenter)
{
pR->L = (int) pR->MW() - (R.right/2);
pR->R = pR->L + R.right;
}
else // (pTxt->mAlign == IText::kAlignFar)
{
pR->L = pR->R - R.right;
pR->R = pR->L + R.right;
}
pR->B = pR->T + R.bottom;
}
else
{
RECT R = { pR->L, pR->T, pR->R, pR->B };
font->DrawText(mDrawBitmap, str, -1, &R, fmt);
}
return true;
}
示例6: Width
bool IGraphicsLice::DrawHorizontalLine(const IColor* pColor, int yi, int xLo, int xHi)
{
int W = Width(), H = Height();
yi = BOUNDED(yi, 0, H - 1);
xLo = BOUNDED(xLo, 0, W - 1);
xHi = BOUNDED(xHi, 0, W - 1);
LICE_pixel px = LiceColor(pColor);
LICE_pixel* pPx = mDrawBitmap->getBits() + yi * W + xLo;
for (int i = xLo; i <= xHi; ++i, ++pPx) {
*pPx = px;
}
return true;
}
示例7: LiceBlendMode
bool IGraphics::FillRoundRect(const IColor* pColor, IRECT* pR, const IChannelBlend* pBlend, int cornerradius, bool aa)
{
int x1 = pR->L;
int y1 = pR->T;
int h = pR->H();
int w = pR->W();
int mode = LiceBlendMode(pBlend);
float weight = LiceWeight(pBlend);
LICE_pixel color = LiceColor(pColor);
_LICE::LICE_FillRect(mDrawBitmap, x1+cornerradius, y1, w-2*cornerradius, h, color, weight, mode);
_LICE::LICE_FillRect(mDrawBitmap, x1, y1+cornerradius, cornerradius, h-2*cornerradius,color, weight, mode);
_LICE::LICE_FillRect(mDrawBitmap, x1+w-cornerradius, y1+cornerradius, cornerradius, h-2*cornerradius, color, weight, mode);
//void LICE_FillCircle(LICE_IBitmap* dest, float cx, float cy, float r, LICE_pixel color, float alpha, int mode, bool aa)
_LICE::LICE_FillCircle(mDrawBitmap, (float) x1+cornerradius, (float) y1+cornerradius, (float) cornerradius, color, weight, mode, aa);
_LICE::LICE_FillCircle(mDrawBitmap, (float) x1+w-cornerradius-1, (float) y1+h-cornerradius-1, (float) cornerradius, color, weight, mode, aa);
_LICE::LICE_FillCircle(mDrawBitmap, (float) x1+w-cornerradius-1, (float) y1+cornerradius, (float) cornerradius, color, weight, mode, aa);
_LICE::LICE_FillCircle(mDrawBitmap, (float) x1+cornerradius, (float) y1+h-cornerradius-1, (float) cornerradius, color, weight, mode, aa);
return true;
}
示例8: LiceColor
bool IGraphicsLice::DrawCircle(const IColor* pColor, float cx, float cy, float r,
const IChannelBlend* pBlend, bool antiAlias)
{
_LICE::LICE_Circle(mDrawBitmap, cx, cy, r, LiceColor(pColor), LiceWeight(pBlend), LiceBlendMode(pBlend), antiAlias);
return true;
}
示例9: CacheFont
bool IGraphics::DrawIText(IText* pTxt, char* str, IRECT* pR, bool measure)
{
if (!str || str[0] == '\0')
{
return true;
}
LICE_IFont* font = pTxt->mCached;
if (!font)
{
font = CacheFont(pTxt);
if (!font) return false;
}
LICE_pixel color = LiceColor(&pTxt->mColor);
font->SetTextColor(color);
#ifdef OS_WIN
UINT fmt = DT_NOCLIP;
#else
// OS X doesn't have an ellipsis option. So we need another way to prevent
// the text from leaving the rectangle.
UINT fmt = 0;
#endif
if (LICE_GETA(color) < 255) fmt |= LICE_DT_USEFGALPHA;
if (pTxt->mAlign == IText::kAlignNear)
fmt |= DT_LEFT;
else if (pTxt->mAlign == IText::kAlignCenter)
fmt |= DT_CENTER;
else // if (pTxt->mAlign == IText::kAlignFar)
fmt |= DT_RIGHT;
// Crop text on Windows if too long
if (!measure) {
fmt |= DT_END_ELLIPSIS;
}
if (measure)
{
fmt |= DT_CALCRECT;
RECT R = {0,0,0,0};
font->DrawText(mDrawBitmap, str, -1, &R, fmt);
if( pTxt->mAlign == IText::kAlignNear)
{
pR->R = R.right;
}
else if (pTxt->mAlign == IText::kAlignCenter)
{
pR->L = (int) pR->MW() - (R.right/2);
pR->R = pR->L + R.right;
}
else // (pTxt->mAlign == IText::kAlignFar)
{
pR->L = pR->R - R.right;
pR->R = pR->L + R.right;
}
pR->B = pR->T + R.bottom;
}
else
{
RECT R = { pR->L, pR->T, pR->R, pR->B };
font->DrawText(mDrawBitmap, str, -1, &R, fmt);
}
return true;
}