当前位置: 首页>>代码示例>>C++>>正文


C++ Application::GetAppResource方法代码示例

本文整理汇总了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;

}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:16,代码来源:ItemForm.cpp

示例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;
}
开发者ID:drstrangecode,项目名称:Bada_RssReader_DrStrangecode,代码行数:76,代码来源:FeedsListItem.cpp


注:本文中的Application::GetAppResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。