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


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

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


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

示例1: main

int main()
{
    Label label;
    label.SetText( "This is a label" );

    Button button;
    button.SetDimensions( 10, 5 );

    TextButton textButton;
    textButton.SetText( "Click Me" );
    textButton.SetDimensions( 10, 5 );

    cout << endl << endl << "LABEL" << endl;
    label.Draw();

    cout << endl << endl << "BUTTON" << endl;
    button.Draw();

    cout << endl << endl << "TEXT BUTTON" << endl;
    textButton.Draw();

    return 0;
}
开发者ID:Rachels-Courses,项目名称:CPP-Course,代码行数:23,代码来源:main.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::Draw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。