本文整理汇总了C++中GFXDrawUtil::drawBitmapStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ GFXDrawUtil::drawBitmapStretch方法的具体用法?C++ GFXDrawUtil::drawBitmapStretch怎么用?C++ GFXDrawUtil::drawBitmapStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFXDrawUtil
的用法示例。
在下文中一共展示了GFXDrawUtil::drawBitmapStretch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onRender
void GuiSwatchButtonCtrl::onRender( Point2I offset, const RectI &updateRect )
{
bool highlight = mMouseOver;
ColorI borderColor = mActive ? ( highlight ? mProfile->mBorderColorHL : mProfile->mBorderColor ) : mProfile->mBorderColorNA;
RectI renderRect( offset, getExtent() );
if ( !highlight )
renderRect.inset( 1, 1 );
GFXDrawUtil *drawer = GFX->getDrawUtil();
drawer->clearBitmapModulation();
// Draw background transparency grid texture...
if ( mGrid.isValid() )
drawer->drawBitmapStretch( mGrid, renderRect );
// Draw swatch color as fill...
if (!mUseSRGB)
drawer->drawRectFill( renderRect, mSwatchColor.toGamma() );
else
drawer->drawRectFill(renderRect, mSwatchColor);
// Draw any borders...
drawer->drawRect( renderRect, borderColor );
}
示例2: onRender
void GuiTheoraCtrl::onRender(Point2I offset, const RectI &updateRect)
{
if( mDone && mIsLooping )
mTheoraTexture.play();
const RectI rect(offset, getBounds().extent);
if( mTheoraTexture.isReady() )
{
mTheoraTexture.refresh();
if( mTheoraTexture.isPlaying()
|| mTheoraTexture.isPaused() )
{
// Draw the frame.
GFXDrawUtil* drawUtil = GFX->getDrawUtil();
drawUtil->clearBitmapModulation();
drawUtil->drawBitmapStretch( mTheoraTexture.getTexture(), rect );
// Draw frame info, if requested.
if( mRenderDebugInfo )
{
String info = String::ToString( "Frame Number: %i | Frame Time: %.2fs | Playback Time: %.2fs | Dropped: %i",
mTheoraTexture.getFrameNumber(),
mTheoraTexture.getFrameTime(),
F32( mTheoraTexture.getPosition() ) / 1000.f,
mTheoraTexture.getNumDroppedFrames() );
drawUtil->setBitmapModulation( mProfile->mFontColors[ 0 ] );
drawUtil->drawText( mProfile->mFont, localToGlobalCoord( Point2I( 0, 0 ) ), info, mProfile->mFontColors );
}
}
else
mDone = true;
}
else
GFX->getDrawUtil()->drawRectFill(rect, mBackgroundColor); // black rect
renderChildControls(offset, updateRect);
}