本文整理汇总了C++中TRgb::_Color4K方法的典型用法代码示例。如果您正苦于以下问题:C++ TRgb::_Color4K方法的具体用法?C++ TRgb::_Color4K怎么用?C++ TRgb::_Color4K使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRgb
的用法示例。
在下文中一共展示了TRgb::_Color4K方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawColor
/** If the display mode of iBitmapInfo is not expected, return EFalse
* or render to the back buffer and returns ETrue
*/
TBool CCommonInterfaces::DrawColor(const TRect& aRect,const TRgb& aColour)
{
TRect local = TRect(aRect.iTl-iRect.iTl, aRect.Size());
TUint16* pBuffer16;
TUint32* pBuffer32;
if (iBitmapInfo.iDisplayMode != iDispMode)
{
return EFalse;
}
for (TInt y = local.iTl.iY; y < local.iBr.iY; y++)
{
for (TInt x = local.iTl.iX; x < local.iBr.iX; x++)
{
switch (iDispMode)
{
case EColor64K:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
break;
case EColor16M:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
break;
case EColor16MU:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MU();
break;
case EColor16MA:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MA();
break;
case EColor4K:
pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color4K();
break;
case EColor16MAP:
pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MAP();
break;
default:
break;
}
}
}
return ETrue;
}