• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ExtTextOut函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ExtTextOut函数的典型用法代码示例。如果您正苦于以下问题:C++ ExtTextOut函数的具体用法?C++ ExtTextOut怎么用?C++ ExtTextOut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: DisplayRecording

void DisplayRecording(int RecNum, int MaxPlayer)
{
	#ifdef _WINDOWS
	HDC hdc;
	HFONT hFO;
	char *text;
	text = new char[10];
	IDirectDrawSurface_GetDC(DX.DDSRender,&hdc);
	hFO=(HFONT)SelectObject(hdc,hGFont);

	SetTextColor(hdc,RGB(0,255,0));
	if (bTransparent)
		SetBkMode(hdc,TRANSPARENT);
	else SetBkColor(hdc,RGB(0,0,0));
	if (RecNum <= MaxPlayer)
	{	
		sprintf(text,"Player %d\0",RecNum);
		ExtTextOut(hdc,2,PSXDisplay.DisplayMode.y-24,0,NULL,text,8,NULL);
	}
	else if (RecNum == MaxPlayer+1)
		ExtTextOut(hdc,2,PSXDisplay.DisplayMode.y-24,0,NULL,"None\0",4,NULL);
	else
		ExtTextOut(hdc,2,PSXDisplay.DisplayMode.y-24,0,NULL,"All\0",3,NULL);			
	SelectObject(hdc,hFO);
	IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc);
	delete text;
	#endif
}
开发者ID:Nitrofski,项目名称:psxjin,代码行数:28,代码来源:menu.cpp


示例2: PaintRectBG

//
//	Draw a rectangle in a single colour. Depending on the run-direction (left/right),
//	the rectangle's position may need to be mirrored within the run before output
//
static 
void PaintRectBG(USPDATA *uspData, ITEM_RUN *itemRun, HDC hdc, int xpos, RECT *rect, ATTR *attr)
{
	RECT rc = *rect;
	
	// rectangle must be mirrored within the run for RTL scripts
	if(itemRun->analysis.fRTL)
	{
		int rtlOffset = xpos*2 + itemRun->width - rc.right - rc.left;
		OffsetRect(&rc, rtlOffset, 0);
	}
	
	// draw selection highlight + add to clipping region
	if(attr->sel)
	{
		SetBkColor(hdc, uspData->selBG);
		ExtTextOut(hdc, 0, 0, ETO_OPAQUE|ETO_CLIPPED, &rc, 0, 0, 0);
		ExcludeClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom);
	}
	// draw normal background 
	else
	{
		SetBkColor(hdc, attr->bg);
		ExtTextOut(hdc, 0, 0, ETO_OPAQUE|ETO_CLIPPED, &rc, 0, 0, 0);
	}
}
开发者ID:MakiseKurisu,项目名称:Neatpad,代码行数:30,代码来源:UspPaint.c


示例3: DisplayInput

void DisplayInput(short P1, short P2)
{
	#ifdef _WINDOWS	
	const unsigned short Order[] = {0x80, 0x10, 0x20, 0x40, 0x8, 0x1, 0x8000, 0x4000, 0x2000, 0x1000, 0x400, 0x400, 0x800, 0x800, 0x100, 0x100, 0x200, 0x200};	
	HDC hdc;
	HFONT hFO;	
	IDirectDrawSurface_GetDC(DX.DDSRender,&hdc);
	hFO=(HFONT)SelectObject(hdc,hGFont);

	SetTextColor(hdc,RGB(0,255,0));
	if (bTransparent)
		SetBkMode(hdc,TRANSPARENT);
	else SetBkColor(hdc,RGB(0,0,0));
	ExtTextOut(hdc,2,PSXDisplay.DisplayMode.y-12,0,NULL,szInputBuf,36,NULL);	
	for (int i = 0; i < 18; i++)
	{
		if (P1&Order[i])
		{NULL;} else szInputBuf[i] = ' ';
	}
	for (int i = 0; i < 18; i++)
	{
		if (P2&Order[i])
		{} else szInputBuf[i+18] = ' ';
	}
	SetTextColor(hdc,RGB(0,255,255));
	SetBkMode(hdc,TRANSPARENT);
	ExtTextOut(hdc,2,PSXDisplay.DisplayMode.y-12,0,NULL,szInputBuf,36,NULL);
	SelectObject(hdc,hFO);
	IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc);
	#endif
}
开发者ID:Nitrofski,项目名称:psxjin,代码行数:31,代码来源:menu.cpp


示例4: DisplayAnalog

void DisplayAnalog(PadDataS padd1, PadDataS padd2)
{
	#ifdef _WINDOWS
	HDC hdc;
	HFONT hFO;
	char tempstr[128];
	IDirectDrawSurface_GetDC(DX.DDSRender,&hdc);
	hFO=(HFONT)SelectObject(hdc,hGFont);

	SetTextColor(hdc,RGB(0,255,0));
	if (bTransparent)
		SetBkMode(hdc,TRANSPARENT);
	else SetBkColor(hdc,RGB(0,0,0));
	int n = 1;
	if (padd2.controllerType !=4)
	{
		sprintf(tempstr,"%03d %03d %03d %03d",padd2.leftJoyX, padd2.leftJoyY, padd2.rightJoyX, padd2.rightJoyY);
		ExtTextOut(hdc,PSXDisplay.DisplayMode.x-90,PSXDisplay.DisplayMode.y-12,0,NULL,tempstr,lstrlen(tempstr),NULL);
		n++;
	}	
	if (padd1.controllerType !=4)
	{
		sprintf(tempstr,"%03d %03d %03d %03d",padd1.leftJoyX, padd1.leftJoyY, padd1.rightJoyX, padd1.rightJoyY);
		ExtTextOut(hdc,PSXDisplay.DisplayMode.x-90,PSXDisplay.DisplayMode.y-(n*12),0,NULL,tempstr,lstrlen(tempstr),NULL);
	}	
	SelectObject(hdc,hFO);
	IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc);
	#endif
}
开发者ID:Nitrofski,项目名称:psxjin,代码行数:29,代码来源:menu.cpp


示例5: SelectObject

BOOL
_DC::DrawText(FONTDef pFont, int x, int y, int flag, _Rect rcClipRect, std::string* pszText, float fStretchCX, float fStretchCY){
	if( !context_ || !pFont ) 
		return FALSE;

	_Font font;
	LOGFONT lf;
	font.Attach(pFont);
	font.GetLogFont(&lf);
	font.Detach();

	lf.lfWidth	= (lf.lfWidth * fStretchCX);
	lf.lfHeight = (lf.lfHeight * fStretchCY);

	_Font fontNew;
	if( fontNew.CreateFontIndirect(&lf) ){
		FONTDef pFontOld = SelectObject(fontNew);
		ExtTextOut(x, y, flag, rcClipRect, pszText->c_str());
		SelectObject(pFontOld);
		fontNew.DeleteObject();
		}
	else{
		FONTDef pFontOld = SelectObject(pFont);
		ExtTextOut(x, y, flag, rcClipRect, pszText->c_str());
		SelectObject(pFontOld);
		}
	return FALSE;
	}
开发者ID:zqrtalent,项目名称:MercuryUI,代码行数:28,代码来源:PlatformDeviceContext_Skia.cpp


示例6: draw_captions

void draw_captions(HDC hdc, WORD t)
{
	int i;
	char szdata[100];

		SetBkColor (hdc, PALETTERGB(0,0,100));
		SetTextColor (hdc, PALETTERGB(255,255,255));
		SetBkMode(hdc, TRANSPARENT);
		SelectObject(hdc, DRAW.scaleFont);
		/*
	
        switch (objects[t]->type) 
		{
				case OB_EVAL:
					strncpy(szdata, ((EVALOBJ *) objects[t])->expression,12);
					szdata[12]='.';szdata[13]='.';szdata[14]=0;
					break;
				case OB_COMPARE:
					switch (((COMPAREOBJ *) objects[t])->method)
					{
							case 0: strcpy(szdata, "A>B"); break;
							case 1: strcpy(szdata, "A>=B"); break;
							case 2: strcpy(szdata, "A<B"); break;
							case 3: strcpy(szdata, "A<=B"); break;
							case 4: strcpy(szdata, "A=B"); break;
					}
					break;
				default: strcpy(szdata, objects[t]->tag); 
					break;
		}*/
		strcpy(szdata, objects[t]->tag); 

		ExtTextOut(hdc, SX+objects[t]->xPos+3,SY+objects[t]->yPos+2, 0, NULL,szdata, strlen(szdata), NULL ) ;

		SetBkColor (hdc, PALETTERGB(0,128,128));
		SetTextColor (hdc, PALETTERGB(100,255,200));
		SelectObject (hdc, DRAW.brush_yellow);
		for (i=0;i<objects[t]->inports;i++)
		{
		  RoundRect(hdc, SX+objects[t]->xPos, SY+objects[t]->yPos+CON_START-4+i*CON_HEIGHT,
		        SX+objects[t]->xPos+CON_MAGNETIC, SY+objects[t]->yPos+CON_START-4+i*CON_HEIGHT+CON_MAGNETIC,
				10, 10);
		  if (!objects[t]->in_ports[i].in_name[0]) wsprintf(szdata,"%d",i+1); else strcpy(szdata,objects[t]->in_ports[i].in_name);
		  ExtTextOut(hdc, SX+objects[t]->xPos+12,SY+objects[t]->yPos-4+CON_START+i*CON_HEIGHT, 0, NULL,szdata, strlen(szdata), NULL ) ;
		  
		}
		SelectObject (hdc, DRAW.brush_orange);
		for (i=0;i<objects[t]->outports;i++)
		{
			RoundRect(hdc, SX+objects[t]->xPos+objects[t]->width-CON_MAGNETIC, SY+objects[t]->yPos+CON_START-4+i*CON_HEIGHT,
		        SX+objects[t]->xPos+objects[t]->width, SY+objects[t]->yPos+CON_START-4+i*CON_HEIGHT+CON_MAGNETIC,
				10, 10); 
		    if (!objects[t]->out_ports[i].out_name[0]) wsprintf(szdata,"%d",i+1); else strcpy(szdata,objects[t]->out_ports[i].out_name);
			SetTextAlign(hdc,TA_RIGHT);
		    ExtTextOut(hdc, SX+objects[t]->xPos+objects[t]->width-CON_MAGNETIC-4, SY+objects[t]->yPos-4+CON_START+i*CON_HEIGHT, 0, NULL,szdata, strlen(szdata), NULL ) ;
			SetTextAlign(hdc,TA_LEFT); 
		}
}
开发者ID:Smeetal,项目名称:BrainBay,代码行数:58,代码来源:draw.cpp


示例7: max

void CCandidateWindow::_DrawList(_In_ HDC dcHandle, _In_ UINT iIndex, _In_ RECT *prc)
{
    int pageCount = 0;
    int candidateListPageCnt = _pIndexRange->Count();

    int cxLine = _TextMetric.tmAveCharWidth;
    int cyLine = max(_cyRow, _TextMetric.tmHeight);
    int cyOffset = (cyLine == _cyRow ? (cyLine-_TextMetric.tmHeight)/2 : 0);

    RECT rc;

	for (;
        (iIndex < _candidateList.Count()) && (pageCount < candidateListPageCnt);
        iIndex++, pageCount++)
    {
        CCandidateListItem* pItemList = _candidateList.GetAt(iIndex);

        rc.top = prc->top + pageCount * cyLine;
        rc.bottom = rc.top + cyLine;

        rc.left = prc->left + PageCountPosition * cxLine;
        rc.right = prc->left + StringPosition * cxLine;

        // Number Font Color And BK
        SetTextColor(dcHandle, CANDWND_NUM_COLOR);
        SetBkColor(dcHandle, GetSysColor(COLOR_3DHIGHLIGHT));

        ExtTextOut(dcHandle, PageCountPosition * cxLine, pageCount * cyLine + cyOffset, ETO_OPAQUE, &rc, pItemList->_FindKeyCode.Get(), (DWORD) pItemList->_FindKeyCode.GetLength(), NULL);

        rc.left = prc->left + StringPosition * cxLine;
        rc.right = prc->right;

        // Candidate Font Color And BK
        if (_currentSelection != iIndex)
        {
            SetTextColor(dcHandle, _crTextColor);
            SetBkColor(dcHandle, GetSysColor(COLOR_3DHIGHLIGHT));
        }
        else
        {
            SetTextColor(dcHandle, CANDWND_SELECTED_ITEM_COLOR);
            SetBkColor(dcHandle, CANDWND_SELECTED_BK_COLOR);
        }

        ExtTextOut(dcHandle, StringPosition * cxLine, pageCount * cyLine + cyOffset, ETO_OPAQUE, &rc, pItemList->_ItemString.Get(), (DWORD)pItemList->_ItemString.GetLength(), NULL);
    }
    for (; (pageCount < candidateListPageCnt); pageCount++)
    {
        rc.top    = prc->top + pageCount * cyLine;
        rc.bottom = rc.top + cyLine;

        rc.left   = prc->left + PageCountPosition * cxLine;
        rc.right  = prc->left + StringPosition * cxLine;

        FillRect(dcHandle, &rc, (HBRUSH)(COLOR_3DHIGHLIGHT+1));
    }
}
开发者ID:takashiro,项目名称:Scoreweaver,代码行数:57,代码来源:CandidateWindow.cpp


示例8: PaintListFolderWindow

int PaintListFolderWindow(HWND hwnd, LISTWINDOW_INFO *lpListWindowInfo)
{
	DIRECTORY_INFO *lpDirectoryInfo;
	char textbuffer[255];

	HDC hdc;
	PAINTSTRUCT psPaint;

	RECT clientRect;
	RECT textRect;

	HFONT hLargeFont;
	HFONT hSmallFont;

	lpDirectoryInfo=&lpListWindowInfo->directoryInfo;	//get the pointer to the directory info block

	hdc = BeginPaint(hwnd, &psPaint);
	GetClientRect(hwnd, &clientRect);

	SetBkColor(hdc, RGB_ZINNY_DARKBLUE);
	SetTextColor(hdc, RGB(255, 255, 255));
	hLargeFont = CreateFont(
				MulDiv(14, GetDeviceCaps(hdc, LOGPIXELSY), 72),
				0,0,0,FW_BOLD,
				FALSE,FALSE,FALSE,
				DEFAULT_CHARSET,OUT_OUTLINE_PRECIS,
                CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY, VARIABLE_PITCH|FF_SWISS,"Arial");

	hSmallFont = CreateFont(
				MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72),
				0,0,0,FW_BOLD,
				FALSE,FALSE,FALSE,
				DEFAULT_CHARSET,OUT_OUTLINE_PRECIS,
                CLIP_DEFAULT_PRECIS,NONANTIALIASED_QUALITY, VARIABLE_PITCH|FF_SWISS,"Arial");

	SelectObject(hdc,hLargeFont);


	textRect.top=0; textRect.bottom=30;
	textRect.left=0; textRect.right=clientRect.right;
	ExtTextOut(hdc, 5,5, ETO_OPAQUE, &textRect, lpDirectoryInfo->directoryName, strlen(lpDirectoryInfo->directoryName), NULL);

	SelectObject(hdc,hSmallFont);
	sprintf(textbuffer, "(%i file%s found)", lpDirectoryInfo->numberOfFiles, (lpDirectoryInfo->numberOfFiles==1)?"":"s");
	textRect.top=30; textRect.bottom=clientRect.bottom;
	textRect.left=0; textRect.right=clientRect.right;
	ExtTextOut(hdc, 5,30, ETO_OPAQUE, &textRect, textbuffer, strlen(textbuffer), NULL);

	DeleteObject(hSmallFont);
	DeleteObject(hLargeFont);

	EndPaint (hwnd, &psPaint);

	return 0;
}
开发者ID:BGCX261,项目名称:zorve-svn-to-git,代码行数:55,代码来源:list.c


示例9: SetBkColor

BOOL CImeView::DisplayCandStrings(HWND hwnd, LPCANDIDATELIST lpCandList)
{
    HDC         hdc;            // Storage for device context handle.
    LPSTR       lpStr;          // Storage for LP to a string.
    DWORD       dwNumPerPage;   // Storage for num per page
    DWORD       dwStartIndex;   // Storage for candidate index
    DWORD       dwEndIndex;     // Storage for candidate index
    RECT        rect;           // Storage for client rect.
    int         y;				// 
    DWORD       dwBackColor;    // Storage for background color value
    DWORD       dwTextColor;
	char		buf[255];

    dwNumPerPage = (!lpCandList->dwPageSize ) ? 
						DEFAULT_CAND_NUM_PER_PAGE : 
						lpCandList->dwPageSize;
    dwStartIndex = lpCandList->dwPageStart;

    dwEndIndex = dwStartIndex + dwNumPerPage;
    dwEndIndex = ( dwEndIndex >= lpCandList->dwCount ) ?
                 lpCandList->dwCount : dwEndIndex;
                 
    hdc = ::GetDC(hwnd);
	// Draw Background
    dwBackColor = SetBkColor(hdc, RGB(0xc0 ,0xc0, 0xc0));
    ::GetClientRect(hwnd, &rect);
    ExtTextOut( hdc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, 0);

	// Draw Selection
    rect.top = rect.top + ( lpCandList->dwSelection - dwStartIndex ) *
               m_charHeight;
    rect.bottom = rect.top + m_charHeight;
    SetBkColor(hdc, RGB(0x00, 0x00, 0x80));
    ExtTextOut( hdc, 0, rect.top, ETO_OPAQUE, &rect, NULL, 0, 0);

    SetBkMode( hdc, TRANSPARENT );
    dwTextColor = GetTextColor(hdc); 

    for (y = 0 ; dwStartIndex < dwEndIndex; dwStartIndex++, y++ ) {
        lpStr = (LPSTR) lpCandList + lpCandList->dwOffset[dwStartIndex];
        if ( dwStartIndex == lpCandList->dwSelection )
            SetTextColor(hdc, RGB(255, 255, 255));
        else
            SetTextColor(hdc, dwTextColor);
		wsprintf(buf, "%d :%s", y + 1, lpStr);
        TextOut(hdc, 2, y * m_charHeight, buf, lstrlen(buf));
    }

    SetTextColor( hdc, dwTextColor );
    SetBkColor( hdc, dwBackColor );
    ::ReleaseDC( hwnd, hdc );
	return TRUE;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:53,代码来源:ImeView.cpp


示例10: DrawCandLine

void DrawCandLine(HDC hDC, LPUIPRIV lpUIPriv, DWORD dwIndex, BOOL fSelected)
{
    LPCANDIDATELIST lpCandList = lpUIPriv->lpCandList;
    DWORD           dwStart, dwEnd;
    int             i;
    RECT            rcCandLine;
    TCHAR           szCandStr[2] = {0};

    RECT            rcAccel;
    TCHAR           szAccelStr[2] = {0};

    dwStart = lpCandList->dwPageStart;

    dwEnd = dwStart + lpCandList->dwPageSize;
    dwEnd = dwEnd > lpCandList->dwCount ? lpCandList->dwCount : dwEnd;

    if (dwIndex > dwEnd) {
        return;
    }

    i = dwIndex - dwStart;
        
    if (fSelected) {
        SetBkColor(hDC, g_sImeUIG.crHighlight);
        SetTextColor(hDC, g_sImeUIG.crHighlightText);
    } else {
        SetBkColor(hDC, g_sImeUIG.crWindow);
        SetTextColor(hDC, g_sImeUIG.crWindowText);
    }

    rcCandLine.left = lpUIPriv->rcCandText.left;
    rcCandLine.right = lpUIPriv->rcCandText.right;

    rcAccel.top = rcCandLine.top = g_sImeUIG.nCandDy[i] - CAND_LINEGAP;
    rcAccel.bottom = rcCandLine.bottom = g_sImeUIG.nCandDy[i + 1];

    rcAccel.left = 0; rcAccel.right = rcCandLine.left;

    szCandStr[0] = *(LPCTSTR)((LPBYTE)lpCandList + lpCandList->dwOffset[dwIndex]);

    ExtTextOut(hDC, g_sImeUIG.nCandDx, g_sImeUIG.nCandDy[i],
               ETO_OPAQUE, &rcCandLine, szCandStr, 1, NULL);

    if (!g_sImeUIG.bAutoCandAccel || !IsSIPOn()) {
        szAccelStr[0] = (TCHAR)(TEXT('1') + i);
        ExtTextOut(hDC, 3, g_sImeUIG.nCandDy[i], ETO_OPAQUE, &rcAccel, szAccelStr, 1, NULL);
    }

    return;
}
开发者ID:jrywu,项目名称:OpenVanilla-Win32,代码行数:50,代码来源:candui.cpp


示例11: drawOutlineText

void drawOutlineText(HDC hdc,int x,int y,const TCHAR * textBuffer,COLORREF color )
{
	size_t len = _tcslen(textBuffer);


	SetTextColor(hdc, RGB_BLACK);
	ExtTextOut( hdc,x -1, y -1, ETO_OPAQUE, NULL, textBuffer , len, NULL );
	ExtTextOut( hdc,x +1, y +1, ETO_OPAQUE, NULL, textBuffer , len, NULL );
	ExtTextOut( hdc,x -1, y   , ETO_OPAQUE, NULL, textBuffer , len, NULL );
	ExtTextOut( hdc,x   , y +1, ETO_OPAQUE, NULL, textBuffer , len, NULL );

	SetTextColor(hdc, color);
	ExtTextOut( hdc,x , y , ETO_OPAQUE, NULL, textBuffer , len, NULL );

}
开发者ID:miza,项目名称:LK8000,代码行数:15,代码来源:LKGeneralAviation.cpp


示例12: TooltipCustDraw

int TooltipCustDraw(LPNMTTCUSTOMDRAW lpttcd) {
	if (lpttcd->nmcd.dwDrawStage == CDDS_PREPAINT) {

		if (gfstate & GFS_UIGRADIENT) {
			DrawGradientFill(lpttcd->nmcd.hdc, &lpttcd->nmcd.rc, gradclr1, gradclr2);
		} else {
			SetBkColor(lpttcd->nmcd.hdc, 0);
			FillRect(lpttcd->nmcd.hdc, &lpttcd->nmcd.rc, hBrushclr);
		}

		//ImageList_DrawEx(lvwIML, 16, lpttcd->nmcd.hdc, lpttcd->nmcd.rc.left + 6, lpttcd->nmcd.rc.top + 6,
		//	36, 18, CLR_DEFAULT, CLR_DEFAULT, ILD_NORMAL);
		DrawIconEx(lpttcd->nmcd.hdc, lpttcd->nmcd.rc.left + 6, lpttcd->nmcd.rc.top + 6,
			hTooltipTmp, 36, 18, 0, NULL, DI_NORMAL);
		SetBkMode(lpttcd->nmcd.hdc, TRANSPARENT);
		HGDIOBJ hOld = SelectObject(lpttcd->nmcd.hdc, hFontBold);						
		ExtTextOut(lpttcd->nmcd.hdc, lpttcd->nmcd.rc.left + 50, lpttcd->nmcd.rc.top + 6,
			ETO_CLIPPED, &lpttcd->nmcd.rc, pszTooltipTitle, strlen(pszTooltipTitle), NULL);
		SelectObject(lpttcd->nmcd.hdc, hFont);
		lpttcd->nmcd.rc.left += 6;
		lpttcd->nmcd.rc.top  += 26;
		DrawText(lpttcd->nmcd.hdc, pszTooltipText, strlen(pszTooltipText), &lpttcd->nmcd.rc, 0);
		SelectObject(lpttcd->nmcd.hdc, hOld);
		return CDRF_SKIPDEFAULT;
	}
	return CDRF_DODEFAULT;
}
开发者ID:kwolekr,项目名称:horizon,代码行数:27,代码来源:gui.cpp


示例13: GetTextExtentPoint

void Statistics::DrawYLabel(HDC hdc, RECT rc, TCHAR *text) {
  SIZE tsize;
  GetTextExtentPoint(hdc, text, _tcslen(text), &tsize);
  int x = max(0,rc.left-tsize.cx);
  int y = rc.top;
  ExtTextOut(hdc, x, y, 0, NULL, text, _tcslen(text), NULL);
}
开发者ID:JanezKolar,项目名称:LK8000,代码行数:7,代码来源:Statistics.cpp


示例14: OutBasket_OnDrawItem

/* This function draws one item in the out-basket list.
 */
void FASTCALL OutBasket_OnDrawItem( HWND hwnd, const DRAWITEMSTRUCT FAR * lpDrawItem )
{
   if( lpDrawItem->itemID != -1 )
      if( lpDrawItem->itemAction == ODA_FOCUS )
         DrawFocusRect( lpDrawItem->hDC, (LPRECT)&lpDrawItem->rcItem );
      else {
         HFONT hOldFont;
         HWND hwndList;
         OBINFO obinfo;
         TEXTMETRIC tm;
         COLORREF tmpT;
         COLORREF tmpB;
         COLORREF T;
         COLORREF B;
         HBRUSH hbr;
         LPOB lpob;
         RECT rc;

         hwndList = GetDlgItem( hwnd, IDD_LIST );
         lpob = (LPOB)ListBox_GetItemData( hwndList, lpDrawItem->itemID );
         Amob_GetObInfo( lpob, &obinfo );
         rc = lpDrawItem->rcItem;
         hOldFont = SelectFont( lpDrawItem->hDC, hOutBasketFont );
         if( lpDrawItem->itemState & ODS_SELECTED )
            {
            T = crHighlightText;
            B = crHighlight;
            }
         else
            {
            T = (obinfo.obHdr.wFlags & OBF_OPEN) ? crIgnoredTopic : crOutBaskText;
            B = crOutBaskWnd;
            }
         hbr = CreateSolidBrush( B );
         tmpT = SetTextColor( lpDrawItem->hDC, T );
         tmpB = SetBkColor( lpDrawItem->hDC, B );
         rc.left = 0;
         rc.right = 32;
         FillRect( lpDrawItem->hDC, &rc, hbr );
         if( obinfo.obHdr.wFlags & OBF_KEEP )
            Amuser_DrawBitmap( lpDrawItem->hDC, rc.left, rc.top, 16, 16, hbmpOutBasket, 1 );
         if( obinfo.obHdr.wFlags & OBF_HOLD )
            Amuser_DrawBitmap( lpDrawItem->hDC, rc.left + 16, rc.top, 16, 16, hbmpOutBasket, 0 );
         if( obinfo.obHdr.wFlags & OBF_ACTIVE )
            Amuser_DrawBitmap( lpDrawItem->hDC, rc.left + 16, rc.top, 16, 16, hbmpOutBasket, 2 );
         if( obinfo.obHdr.wFlags & OBF_SCRIPT )
            Amuser_DrawBitmap( lpDrawItem->hDC, rc.left + 16, rc.top, 16, 16, hbmpOutBasket, 4 );
         if( obinfo.obHdr.wFlags & OBF_ERROR )
            Amuser_DrawBitmap( lpDrawItem->hDC, rc.left + 16, rc.top, 16, 16, hbmpOutBasket, 3 );
         rc.left = rc.right;
         rc.right = lpDrawItem->rcItem.right;
         Amob_Describe( lpob, lpTmpBuf );
         GetTextMetrics( lpDrawItem->hDC, &tm );
         ExtTextOut( lpDrawItem->hDC, rc.left, rc.top, ETO_OPAQUE, &rc, lpTmpBuf, strlen( lpTmpBuf ), NULL );
         SelectFont( lpDrawItem->hDC, hOldFont );
         SetTextColor( lpDrawItem->hDC, tmpT );
         SetBkColor( lpDrawItem->hDC, tmpB );
         DeleteBrush( hbr );
         }
}
开发者ID:cixonline,项目名称:ameol,代码行数:62,代码来源:outbask.c


示例15: create_mf

static HMETAFILE create_mf(void)
{
    RECT rect = {0, 0, 100, 100};
    HDC hdc = CreateMetaFile(NULL);
    ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rect, "Test String", strlen("Test String"), NULL);
    return CloseMetaFile(hdc);
}
开发者ID:pstrealer,项目名称:wine,代码行数:7,代码来源:usrmarshal.c


示例16: CrashIf

// based on http://theartofdev.wordpress.com/2013/10/24/transparent-text-rendering-with-gdi/,
// TODO: look into using http://theartofdev.wordpress.com/2014/01/12/gdi-text-rendering-to-image/
// TODO: doesn't actually look good (i.e. similar to DrawText when using transparent SetBkMode())
// which kind of makes sense, because I'm using transparent mode to draw to in-memory bitmap as well
// TODO: doesn't actually do alpha bf.SourceConstantAlpha > 4 looks the same, values 1-4 produce
// different, but not expected, results
// TODO: I would like to figure out a way to draw text without the need to Lock()/Unlock()
// maybe draw to in-memory bitmap, convert to Graphics bitmap and blit that bitmap to
// Graphics object
void TextRenderGdi::DrawTransparent(const WCHAR *s, size_t sLen, RectF& bb, bool isRtl) {
    CrashIf(!hdcGfxLocked); // hasn't been Lock()ed

    int x = (int) bb.X;
    int y = (int) bb.Y;
    int dx = (int) bb.Width;
    int dy = (int) bb.Height;

    CreateClearBmpOfSize(dx,dy);
    //SetBkMode(hdcGfxLocked, 1);
    SetBkMode(memHdc, TRANSPARENT);

    //BitBlt(memHdc, 0, 0, dx, dy, hdcGfxLocked, x, y, SRCCOPY);
    SelectObject(memHdc, currFont);
    ::SetTextColor(memHdc, textColor.ToCOLORREF());

#if 0
    TextOut(memHdc, 0, 0, s, sLen);
#else
    UINT opts = 0; //ETO_OPAQUE;
    if (isRtl)
        opts = opts | ETO_RTLREADING;
    ExtTextOut(memHdc, 0, 0, opts, nullptr, s, (UINT)sLen, nullptr);
#endif

    BLENDFUNCTION bf = {};
    bf.BlendOp = AC_SRC_OVER;
    bf.BlendFlags = 0;
    bf.AlphaFormat = 0; // 0 - ignore source alpha, AC_SRC_ALPHA (1) - use source alpha
    bf.SourceConstantAlpha = 0x3; //textColor.GetA();
    AlphaBlend(hdcGfxLocked, x, y, dx, dy, memHdc, 0, 0, dx, dy, bf);
}
开发者ID:qingzhengzhuma,项目名称:sumatrapdf,代码行数:41,代码来源:TextRender.cpp


示例17: PreviewWndProc

LONG CALLBACK PreviewWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	RECT		rect;
	PAINTSTRUCT ps;
	HANDLE		hold;

	switch(msg)
	{
	case WM_ERASEBKGND:
		return 1;

	case WM_PAINT:
		BeginPaint(hwnd, &ps);
		
		GetClientRect(hwnd, &rect);

		FrameRect(ps.hdc, &rect, GetSysColorBrush(COLOR_3DSHADOW));
		InflateRect(&rect, -1, -1);

		SetTextColor(ps.hdc, g_crPreviewFG);
		SetBkColor(ps.hdc, g_crPreviewBG);

		ExtTextOut(ps.hdc, 0, 0, ETO_OPAQUE, &rect, 0, 0, 0);
		hold = SelectObject(ps.hdc, g_hPreviewFont);

		DrawText(ps.hdc, _T("Sample Text"), -1, &rect, DT_SINGLELINE|DT_CENTER|DT_VCENTER);
		
		SelectObject(ps.hdc, hold);
		EndPaint(hwnd, &ps);
		return 0;
	}

	return CallWindowProc(oldPreviewProc, hwnd, msg, wParam, lParam);
}
开发者ID:MakiseKurisu,项目名称:Neatpad,代码行数:34,代码来源:OptionsFont.c


示例18: DisplayMovMode

void DisplayMovMode(void)
{
#ifdef _WINDOWS
	HDC hdc;
	HFONT hFO;

	IDirectDrawSurface_GetDC(DX.DDSRender,&hdc);

	hFO=(HFONT)SelectObject(hdc,StatusFont);

	if (modeFlags&MODE_FLAG_RECORD)
		SetTextColor(hdc,RGB(255,0,0));
	else if (modeFlags&MODE_FLAG_REPLAY)
		SetTextColor(hdc,RGB(255,255,255));
	else
		SetTextColor(hdc,RGB(0,255,0));

	SetBkMode(hdc,TRANSPARENT);
	SetTextAlign(hdc, TA_TOP | TA_RIGHT);

	ExtTextOut(hdc,PSXDisplay.DisplayMode.x-3,2,0,NULL,cCurrentMode,lstrlen(cCurrentMode),NULL);

	SelectObject(hdc,hFO);
	IDirectDrawSurface_ReleaseDC(DX.DDSRender,hdc);
#endif
}
开发者ID:gcfavorites,项目名称:feos-tas,代码行数:26,代码来源:menu.c


示例19: clear_rect

    static void
clear_rect(RECT *rcp)
{
    /* Use trick for fast rect clear */
    gui_mch_set_bg_color(gui.back_pixel);
    ExtTextOut(s_hdc, 0, 0, ETO_CLIPPED | ETO_OPAQUE, rcp, NULL, 0, NULL);
}
开发者ID:Stolas,项目名称:vim-qt,代码行数:7,代码来源:gui_w16.c


示例20: create_emf

static HENHMETAFILE create_emf(void)
{
    const RECT rect = {0, 0, 100, 100};
    HDC hdc = CreateEnhMetaFile(NULL, NULL, &rect, "HENHMETAFILE Marshaling Test\0Test\0\0");
    ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rect, "Test String", strlen("Test String"), NULL);
    return CloseEnhMetaFile(hdc);
}
开发者ID:pstrealer,项目名称:wine,代码行数:7,代码来源:usrmarshal.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Extract函数代码示例发布时间:2022-05-30
下一篇:
C++ ExpressionData函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap