本文整理汇总了C++中GFXDrawUtil::getBitmapModulation方法的典型用法代码示例。如果您正苦于以下问题:C++ GFXDrawUtil::getBitmapModulation方法的具体用法?C++ GFXDrawUtil::getBitmapModulation怎么用?C++ GFXDrawUtil::getBitmapModulation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFXDrawUtil
的用法示例。
在下文中一共展示了GFXDrawUtil::getBitmapModulation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onRender
void GuiInspectorField::onRender( Point2I offset, const RectI &updateRect )
{
RectI ctrlRect(offset, getExtent());
// Render fillcolor...
if ( mProfile->mOpaque )
GFX->getDrawUtil()->drawRectFill(ctrlRect, mProfile->mFillColor);
// Render caption...
if ( mCaption && mCaption[0] )
{
// Backup current ClipRect
RectI clipBackup = GFX->getClipRect();
RectI clipRect = updateRect;
// The rect within this control in which our caption must fit.
RectI rect( offset + mCaptionRect.point + mProfile->mTextOffset, mCaptionRect.extent + Point2I(1,1) - Point2I(5,0) );
// Now clipRect is the amount of our caption rect that is actually visible.
bool hit = clipRect.intersect( rect );
if ( hit )
{
GFX->setClipRect( clipRect );
GFXDrawUtil *drawer = GFX->getDrawUtil();
// Backup modulation color
ColorI currColor;
drawer->getBitmapModulation( &currColor );
// Draw caption background...
if( !isActive() )
GFX->getDrawUtil()->drawRectFill( clipRect, mProfile->mFillColorNA );
else if ( mHighlighted )
GFX->getDrawUtil()->drawRectFill( clipRect, mProfile->mFillColorHL );
// Draw caption text...
drawer->setBitmapModulation( !isActive() ? mProfile->mFontColorNA : mHighlighted ? mProfile->mFontColorHL : mProfile->mFontColor );
// Clip text with '...' if too long to fit
String clippedText( mCaption );
clipText( clippedText, clipRect.extent.x );
renderJustifiedText( offset + mProfile->mTextOffset, getExtent(), clippedText );
// Restore modulation color
drawer->setBitmapModulation( currColor );
// Restore previous ClipRect
GFX->setClipRect( clipBackup );
}
}
// Render Children...
renderChildControls(offset, updateRect);
// Render border...
if ( mProfile->mBorder )
renderBorder(ctrlRect, mProfile);
// Render divider...
Point2I worldPnt = mEditCtrlRect.point + offset;
GFX->getDrawUtil()->drawLine( worldPnt.x - 5,
worldPnt.y,
worldPnt.x - 5,
worldPnt.y + getHeight(),
!isActive() ? mProfile->mBorderColorNA : mHighlighted ? mProfile->mBorderColorHL : mProfile->mBorderColor );
}