本文整理汇总了C++中BitmapImage::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::Init方法的具体用法?C++ BitmapImage::Init怎么用?C++ BitmapImage::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateSettings
void UpdateSettings()
{
bitmapImage.SetPath(data->GetString(TEXT("path")));
bitmapImage.EnableFileMonitor(data->GetInt(TEXT("monitor"), 0) == 1);
bitmapImage.Init();
//------------------------------------
opacity = data->GetInt(TEXT("opacity"), 100);
color = data->GetInt(TEXT("color"), 0xFFFFFFFF);
if(opacity > 100)
opacity = 100;
bool bNewUseColorKey = data->GetInt(TEXT("useColorKey"), 0) != 0;
keyColor = data->GetInt(TEXT("keyColor"), 0xFFFFFFFF);
keySimilarity = data->GetInt(TEXT("keySimilarity"), 10);
keyBlend = data->GetInt(TEXT("keyBlend"), 0);
bUseColorKey = bNewUseColorKey;
}
示例2: UpdateSettings
void UpdateSettings()
{
for(UINT i=0; i<bitmapImages.Num(); i++)
delete bitmapImages[i];
bitmapImages.Clear();
//------------------------------------
bool bFirst = true;
StringList bitmapList;
data->GetStringList(TEXT("bitmap"), bitmapList);
for(UINT i=0; i<bitmapList.Num(); i++)
{
String &strBitmap = bitmapList[i];
if(strBitmap.IsEmpty())
{
AppWarning(TEXT("BitmapTransitionSource::UpdateSettings: Empty path"));
continue;
}
BitmapImage *bitmapImage = new BitmapImage;
bitmapImage->SetPath(strBitmap);
bitmapImage->EnableFileMonitor(false);
bitmapImage->Init();
if(bFirst)
{
fullSize = bitmapImage->GetSize();
baseAspect = double(fullSize.x)/double(fullSize.y);
bFirst = false;
}
bitmapImages << bitmapImage;
}
//------------------------------------
transitionTime = data->GetFloat(TEXT("transitionTime"));
if(transitionTime < MIN_TRANSITION_TIME)
transitionTime = MIN_TRANSITION_TIME;
else if(transitionTime > MAX_TRANSITION_TIME)
transitionTime = MAX_TRANSITION_TIME;
//------------------------------------
bFadeInOnly = data->GetInt(TEXT("fadeInOnly"), 1) != 0;
bDisableFading = data->GetInt(TEXT("disableFading")) != 0;
bRandomize = data->GetInt(TEXT("randomize")) != 0;
//------------------------------------
curTransitionTime = 0.0f;
curTexture = 0;
if(bRandomize)
{
srand( (unsigned)time( NULL ) );
if(bitmapImages.Num() > 1)
{
curTexture = lrand(bitmapImages.Num());
while((nextTexture = lrand(bitmapImages.Num())) == curTexture);
}
}
else
nextTexture = (curTexture == bitmapImages.Num()-1) ? 0 : curTexture+1;
bTransitioning = false;
curFadeValue = 0.0f;
}