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


C++ Dialog::DrawText方法代码示例

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


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

示例1: DrawTextInput

void AlliesWhiteboard::DrawTextInput(LPDIRECTDRAWSURFACE DestSurf)
{
	Dialog *DialogPTR = (Dialog*)LocalShare->Dialog;
	int BFHalfX = (LocalShare->ScreenWidth-128)/2 + 128;
	int BFHalfY = (LocalShare->ScreenHeight-64)/2 + 32;

	if(CurrentElement)
		DialogPTR->DrawText(DestSurf, BFHalfX-InputBoxWidth/2+5, BFHalfY-InputBoxHeight/2-13, "Edit Textmarker");
	else
		DialogPTR->DrawText(DestSurf, BFHalfX-InputBoxWidth/2+5, BFHalfY-InputBoxHeight/2-13, "Add Textmarker");

	DDBLTFX ddbltfx;
	DDRAW_INIT_STRUCT(ddbltfx);
	ddbltfx.ddckSrcColorkey.dwColorSpaceLowValue = 102;
	ddbltfx.ddckSrcColorkey.dwColorSpaceHighValue = 102;
	RECT Dest;
	Dest.left = BFHalfX-InputBoxWidth/2;
	Dest.top = BFHalfY-InputBoxHeight/2;
	Dest.right = Dest.left+InputBoxWidth;
	Dest.bottom = Dest.top+InputBoxHeight;
	if(DestSurf->Blt(&Dest, lpInputBox, NULL, DDBLT_ASYNC | DDBLT_KEYSRCOVERRIDE, &ddbltfx)!=DD_OK)
	{
		DestSurf->Blt(&Dest, lpInputBox, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
	}

	DialogPTR->DrawSmallText(DestSurf, BFHalfX-(InputBoxWidth/2)+14, BFHalfY-5, Text);

	//draw cursor if textbox overlap
	if((MouseX-128)>Dest.left-10 && (MouseX-128)<Dest.right && (MouseY-32)>Dest.top-34 && (MouseY-32)<Dest.bottom)
		DialogPTR->BlitCursor(DestSurf, MouseX-128, MouseY-32);
}
开发者ID:jchristi,项目名称:taddraw,代码行数:31,代码来源:whiteboard.cpp

示例2: DrawTextMarker

void AlliesWhiteboard::DrawTextMarker(LPDIRECTDRAWSURFACE DestSurf, int X, int Y, char *cText, char C)
{
	int x = X - *MapX + 128;
	int y = Y - *MapY + 32;

	DDBLTFX ddbltfx;
	DDRAW_INIT_STRUCT(ddbltfx);
	ddbltfx.ddckSrcColorkey.dwColorSpaceLowValue = 102;
	ddbltfx.ddckSrcColorkey.dwColorSpaceHighValue = 102;
	RECT Dest;
	Dest.left = x-TextMarkerWidth/2;
	Dest.top = y-TextMarkerHeight/2;
	Dest.right = Dest.left+TextMarkerWidth;
	Dest.bottom = Dest.top+TextMarkerHeight;
	RECT Source;
	Source.left = C*TextMarkerWidth;
	Source.top = 0;
	Source.right = Source.left+TextMarkerWidth;
	Source.bottom = TextMarkerHeight;
	if(DestSurf->Blt(&Dest, lpSmallCircle, &Source, DDBLT_ASYNC | DDBLT_KEYSRCOVERRIDE, &ddbltfx)!=DD_OK)
	{
		DestSurf->Blt(&Dest, lpSmallCircle, &Source, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
	}

	Dialog *pDialog = (Dialog*)LocalShare->Dialog;
	pDialog->DrawText(DestSurf, x+TextMarkerWidth , y-5, cText);
}
开发者ID:jchristi,项目名称:taddraw,代码行数:27,代码来源:whiteboard.cpp


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