本文整理汇总了C++中Application::GetAppResource方法的典型用法代码示例。如果您正苦于以下问题:C++ Application::GetAppResource方法的具体用法?C++ Application::GetAppResource怎么用?C++ Application::GetAppResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::GetAppResource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDraw
result ItemForm::OnDraw(void) {
result r = E_SUCCESS;
Canvas* pCanvas = GetCanvasN();
Rectangle rt = pCanvas->GetBounds();
Application * app = Application::GetInstance();
AppResource * res = app->GetAppResource();
Bitmap * pBitmap = res->GetBitmapN(L"form_bg.png", BITMAP_PIXEL_FORMAT_ARGB8888);
pCanvas->DrawBitmap(rt, *pBitmap);
delete pBitmap;
delete pCanvas;
return r;
}
示例2: Construct
result FeedsListItem::Construct(int width, String & title, String & categories, String & about) {
Dimension dimension = Dimension(width, ITEM_HEIGHT);
ListAnnexStyle annexStyle = LIST_ANNEX_STYLE_DETAILED;
int contentWidth = width - ListItemBase::GetAnnexWidth(annexStyle);
result r = CustomItem::Construct(dimension, annexStyle);
Application * app = Application::GetInstance();
AppResource * res = app->GetAppResource();
pRowIcon = res->GetBitmapN(L"row-icon.png",
BITMAP_PIXEL_FORMAT_ARGB8888);
pRowSeparatorBitmap = res->GetBitmapN(L"separator.png",
BITMAP_PIXEL_FORMAT_ARGB8888);
Rectangle icoDim = Rectangle(ITEM_LEFT_MARGIN,
0,
ICON_DIMENSION,
ICON_DIMENSION);
Rectangle titleDim = Rectangle(ITEM_LEFT_MARGIN + ICON_DIMENSION,
0,
contentWidth - ICON_DIMENSION - ITEM_LEFT_MARGIN,
ITEM_HEIGHT / 3);
Rectangle categoriesDim = Rectangle(titleDim.x,
titleDim.y + titleDim.height,
titleDim.width,
titleDim.height);
Rectangle aboutDim = Rectangle(categoriesDim.x,
categoriesDim.y + categoriesDim.height,
categoriesDim.width,
categoriesDim.height);
Rectangle separatorDim = Rectangle(0,
ITEM_HEIGHT - pRowSeparatorBitmap->GetHeight(),
width,
pRowSeparatorBitmap->GetHeight());
AddElement(titleDim,
TITLE_ELM_ID,
title,
28,
Color::COLOR_WHITE,
Color::COLOR_BLACK,
Color::COLOR_BLACK,
true);
AddElement(categoriesDim,
CATEGORIES_ELM_ID,
categories,
22,
Color::COLOR_GREY,
Color::COLOR_BLACK,
Color::COLOR_BLACK,
true);
AddElement(aboutDim,
ABOUT_ELM_ID,
about,
18,
Color::COLOR_GREY,
Color::COLOR_BLACK,
Color::COLOR_BLACK,
true);
AddElement(separatorDim,
SEPARATOR_ELM_ID,
*pRowSeparatorBitmap,
pRowSeparatorBitmap,
pRowSeparatorBitmap);
return r;
}