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


C++ Label::SetBackgroundBitmap方法代码示例

本文整理汇总了C++中Label::SetBackgroundBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::SetBackgroundBitmap方法的具体用法?C++ Label::SetBackgroundBitmap怎么用?C++ Label::SetBackgroundBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Label的用法示例。


在下文中一共展示了Label::SetBackgroundBitmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: labelText

void
UserProfileForm::OnTransactionReadyToRead(HttpSession& httpSession, HttpTransaction& httpTransaction, int availableBodyLen)
{

	AppLogDebug("OnTransactionReadyToRead,..availableBodyLen=%d",availableBodyLen);
	count++;

	HttpResponse* pHttpResponse = httpTransaction.GetResponse();

	if(pHttpResponse->GetHttpStatusCode() == HTTP_STATUS_OK)
	{
		__pBuffer = pHttpResponse->ReadBodyN();
	}
	if(__pProfileName==NULL)
	{
		ParseJsonData();
		Label *pLabel = new Label();
		String labelText(L"Welcome ");
		labelText.Append(*__pProfileName);
		AppLog("labelText is =%ls",labelText.GetPointer());
		pLabel->Construct(Rectangle(05, 50, 500, 100), labelText);
		AddControl(*pLabel);
		Draw();
		Show();

		__pSession->CloseTransaction(httpTransaction);
		delete __pSession;
		__pSession = null;
	}

	//Get Profile Picture

	String imageurl;
	imageurl.Append(L"https://graph.facebook.com/me");
	imageurl.Append(L"/picture?");
	imageurl.Append(L"access_token=");
	imageurl.Append(__accessToken);
	SendRequestGet(imageurl);

	__pProfileImage = new Image();
	__pProfileImage->Construct();

	Bitmap *pBitmap;
	pBitmap=__pProfileImage->DecodeN(*__pBuffer,IMG_FORMAT_JPG,BITMAP_PIXEL_FORMAT_ARGB8888,150,150);
	Label *pImageLabel = new Label();
	pImageLabel->Construct(Rectangle(150,150, 150, 150),"");
	pImageLabel->SetBackgroundBitmap(*pBitmap);
	AddControl(*pImageLabel);

	Button* pGetFriends = new Button();
	pGetFriends->Construct(Rectangle(30,330, 350, 70), L"Get Friends");
	pGetFriends->SetActionId(ID_BUTTON_FRIENDS_CLICKED);
	pGetFriends->AddActionEventListener(*this);
	AddControl(*pGetFriends);

	Button* pLogout = new Button();
	pLogout->Construct(Rectangle(30,430, 350, 70), L"Logout");
	pLogout->SetActionId(ID_BUTTON_LOGOUT_CLICKED);
	pLogout->AddActionEventListener(*this);
	AddControl(*pLogout);
	Draw();
	Show();

}
开发者ID:claymodel,项目名称:bigcloud,代码行数:64,代码来源:UserProfileForm.cpp

示例2: Label

result
SettingForm::OnInitializing(void)
{
	result r = E_SUCCESS;

	// TODO: Add your initialization code here
	FooterItem footerItem[5];
	AppResource* pAppResource = Application::GetInstance()->GetAppResource();

	Image inActivation_Image[5];
	String inActivation_Path[5];

	Image Activation_Image[5];
	String Activation_Path[5];

	for(int i=0; i<5; i++)
	{
		inActivation_Image[i].Construct();
		inActivation_Path[i] = App::GetInstance()->GetAppResourcePath();

		Activation_Image[i].Construct();
		Activation_Path[i] = App::GetInstance()->GetAppResourcePath();
	}

	inActivation_Path[0] += L"screen-density-xhigh/TimeLine_InAct.png";
	Activation_Path[0] += L"screen-density-xhigh/TimeLine_Act.png";

	footerItem[0].Construct(ID_FOOTER_ITEM1);

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[0].DecodeN(inActivation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[0].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[0].DecodeN(Activation_Path[0], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[1] += L"screen-density-xhigh/Chatting_InAct.png";
	Activation_Path[1] += L"screen-density-xhigh/Chatting_Act.png";

	footerItem[1].Construct(ID_FOOTER_ITEM2);

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[1].DecodeN(inActivation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[1].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[1].DecodeN(Activation_Path[1], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[2] += L"screen-density-xhigh/PartnerList_InAct.png";
	Activation_Path[2] += L"screen-density-xhigh/PartnerList_Act.png";

	footerItem[2].Construct(ID_FOOTER_ITEM3);

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[2].DecodeN(inActivation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[2].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[2].DecodeN(Activation_Path[2], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[3] += L"screen-density-xhigh/PartnerResearch_InAct.png";
	Activation_Path[3] += L"screen-density-xhigh/PartnerResearch_Act.png";

	footerItem[3].Construct(ID_FOOTER_ITEM4);

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	inActivation_Image[3].DecodeN(inActivation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[3].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	Activation_Image[3].DecodeN(Activation_Path[3], BITMAP_PIXEL_FORMAT_ARGB8888));

	inActivation_Path[4] += L"screen-density-xhigh/Setting_InAct.png";
	Activation_Path[4] += L"screen-density-xhigh/Setting_Act.png";

	footerItem[4].Construct(ID_FOOTER_ITEM5);

	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_PRESSED,
	inActivation_Image[4].DecodeN(inActivation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));

	footerItem[4].SetBackgroundBitmap(FOOTER_ITEM_STATUS_NORMAL,
	Activation_Image[4].DecodeN(Activation_Path[4], BITMAP_PIXEL_FORMAT_ARGB8888));

	Label* pLabel;
	pLabel = new Label();

	pLabel->Construct(Rectangle(0,0,this->GetWidth(),this->GetHeight()),L"");
	AppLog("%d ,,,,%d", this->GetWidth(),this->GetHeight());
	pLabel->SetBackgroundBitmap(*pAppResource->GetBitmapN(L"fakepicture.png"));
	pLabel->Draw();

	AddControl(pLabel);
	Footer* pFooter = GetFooter();
	if (pFooter)
	{
		pFooter->AddActionEventListener(*this);
	}

	pFooter->AddItem(footerItem[0]);
	pFooter->AddItem(footerItem[1]);
	pFooter->AddItem(footerItem[2]);
	pFooter->AddItem(footerItem[3]);
	pFooter->AddItem(footerItem[4]);
	// Setup back event listener
//.........这里部分代码省略.........
开发者ID:JunminLee,项目名称:Winwin,代码行数:101,代码来源:SettingForm.cpp


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