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

C++ MoveToEx函数代码示例

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

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



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

示例1: WindowProcedure


//.........这里部分代码省略.........
                }

                if((wParam == MK_LBUTTON)&&(Button_GetCheck(hwndEllipseTool) == BST_CHECKED)) {
                    newEllipse.left = xMouse;
                    newEllipse.top = yMouse;
                    firstEllipse = true;
                }

                if((wParam == MK_LBUTTON)&&(Button_GetCheck(hwndBezierTool) == BST_CHECKED)) {
                    pointsforBezier[0] = point;
                    firstBezier  = true;
                    secondBezier = false;
                    thirdBezier  = false;
                }
            }
            return 0;

        case WM_LBUTTONUP:

            xMouse = GET_X_LPARAM(lParam);
            yMouse = GET_Y_LPARAM(lParam);

            strokeRGB = GetPixel(hdc, xStrokePreview + 20, yStrokePreview + 20);
            fillRGB = GetPixel(hdc, xFillPreview + 20, yFillPreview + 20);
            strokeWeight = getWeight(hwndStrokeWeight);

            if(firstLine) {
                point = drawingLimits(xMouse, yMouse, drawingArea, strokeWeight);
                xMouse = point.x;
                yMouse = point.y;

                strokePen = CreatePen(PS_SOLID, strokeWeight, strokeRGB);
                SelectObject(hdc, strokePen);
                MoveToEx(hdc, xMouse, yMouse, NULL);
                LineTo(hdc, newLine.x, newLine.y);
                DeleteObject(strokePen);

                firstLine = false;
            }

            if(firstPolygon) {
                point = drawingLimits(xMouse, yMouse, drawingArea, strokeWeight);
                newPolygon.right = point.x;
                newPolygon.bottom = point.y;

                strokePen = CreatePen(PS_SOLID, strokeWeight, strokeRGB);
                fillBrush = (Button_GetCheck(hwndFillCheck) == BST_CHECKED)? CreateSolidBrush(fillRGB) : (HBRUSH)GetStockObject(NULL_BRUSH);
                SelectObject(hdc, strokePen);
                SelectObject(hdc, fillBrush);
                Rectangle(hdc, newPolygon.left, newPolygon.top, newPolygon.right, newPolygon.bottom);
                DeleteObject(strokePen);
                DeleteObject(fillBrush);

                lastRegion = getLastRectRegion(newPolygon, strokeWeight, &regionDeleted);

                firstPolygon = false;
            }

            if(firstEllipse) {
                point = drawingLimits(xMouse, yMouse, drawingArea, strokeWeight);
                newEllipse.right = point.x;
                newEllipse.bottom = point.y;

                strokePen = CreatePen(PS_SOLID, strokeWeight, strokeRGB);
                fillBrush = (Button_GetCheck(hwndFillCheck) == BST_CHECKED)? CreateSolidBrush(fillRGB) : (HBRUSH)GetStockObject(NULL_BRUSH);
                SelectObject(hdc, strokePen);
开发者ID:TUM-FAF,项目名称:FAF-141-Croitoru-Vlad,代码行数:67,代码来源:main.cpp


示例2: drawSplashWindow

/// Function name  : drawSplashWindow
// Description     : Paints the splash window and the progress of the load game data operation
// 
// HWND  hWnd  : [in] Splash window
// 
VOID  drawSplashWindow(SPLASH_WINDOW_DATA*  pWindowData)
{
   BLENDFUNCTION  oBlendData;             // Alpha blending data
   DC_STATE*      pDCState;               // DC state
   POINT          ptOrigin;               // Drawing origin into the memory DC
   SIZE           siWindowSize;           // Size of the splash window
   RECT           rcProgressText;         // Progress stage text drawing rectangle
   TCHAR*         szProgressText;         // Progress stage text
   HDC            hScreenDC,
                  hMemoryDC;              // Memory DC
   UINT           iCurrentProgress,       // Operation progress : 0 <= n <= 10000
                  iProgressBarLength;     // Length of the progress bar, in pixels

   // Prepare
   utilZeroObject(&oBlendData, BLENDFUNCTION);
   siWindowSize = siLogoBitmap;
   ptOrigin.x = 0;
   ptOrigin.y = 0;

   /// Create DC, Pen, Font, Bitmap and progress text
   hScreenDC      = GetDC(NULL);
   hMemoryDC      = CreateCompatibleDC(hScreenDC);
   pDCState       = utilCreateDeviceContextState(hMemoryDC);
   szProgressText = loadString(getCurrentOperationStageID(getMainWindowData()->pOperationPool), 128);

   /// Create bitmap
   pWindowData->hLogoBitmap = (HBITMAP)LoadImage(getResourceInstance(), TEXT("LOGO_BITMAP"), IMAGE_BITMAP, siLogoBitmap.cx, siLogoBitmap.cy, LR_CREATEDIBSECTION);
   
   // Setup DC
   utilSetDeviceContextBitmap(pDCState, pWindowData->hLogoBitmap);
   utilSetDeviceContextPen(pDCState, pWindowData->hProgressPen);
   utilSetDeviceContextFont(pDCState, pWindowData->hProgressFont, clProgressBar);
   utilSetDeviceContextBackgroundMode(pDCState, TRANSPARENT);

   // Request per-pixel alpha blending
   oBlendData.BlendOp             = AC_SRC_OVER;
   oBlendData.AlphaFormat         = AC_SRC_ALPHA;
   oBlendData.SourceConstantAlpha = 255;

   // Calculate progress and text rectangles
   iCurrentProgress   = getCurrentOperationProgress(getMainWindowData()->pOperationPool);
   iProgressBarLength = (ptProgressBarEnd.x - ptProgressBarStart.x) * iCurrentProgress / iProgressBarMaximum;
   SetRect(&rcProgressText, ptProgressBarStart.x - 20, ptProgressBarStart.y + 3, ptProgressBarEnd.x + 20, ptProgressBarEnd.y + 20);

   /// [PROGRESS] Draw progress bar
   MoveToEx(hMemoryDC, ptProgressBarStart.x, ptProgressBarStart.y, NULL);
   LineTo(hMemoryDC, (ptProgressBarStart.x + iProgressBarLength), ptProgressBarEnd.y);

   /// [TEXT] Draw progress text
   DrawText(hMemoryDC, szProgressText, lstrlen(szProgressText), &rcProgressText, DT_SINGLELINE WITH DT_CENTER);

   /// [LOGO] Paint alpha-blended logo
   if (!UpdateLayeredWindow(pWindowData->hWnd, NULL, NULL, &siWindowSize, hMemoryDC, &ptOrigin, 0, &oBlendData, ULW_ALPHA))
      ERROR_CHECK("updating layered window", FALSE);

   // [CHECK] Are we running in windows 7 or newer?
   if (getAppWindowsVersion() >= WINDOWS_7)
      /// [WINDOWS 7] Display progress in the taskbar
      utilSetWindowProgressValue(getAppWindow(), iCurrentProgress, iProgressBarMaximum);

   // Cleanup
   utilDeleteDeviceContextState(pDCState);
   DeleteDC(hMemoryDC);
   DeleteBitmap(pWindowData->hLogoBitmap);
   ReleaseDC(NULL, hScreenDC);
   utilDeleteString(szProgressText);
}
开发者ID:nick-crowley,项目名称:X-Studio,代码行数:72,代码来源:Splash+Window.cpp


示例3: DrawLine

static void DrawLine(void *data, long x1, long y1, long x2, long y2)
{
  MoveToEx((HDC)data, x1, y1, NULL);
  LineTo((HDC)data,x2,y2);
}
开发者ID:jpflori,项目名称:pari,代码行数:5,代码来源:plotWin32.c


示例4: DrawLayers

void DrawLayers(HDC hdc, int x, int y, int width, int height, int type)
{
	double maxHeight = CSnow::current()->getSnowHeight();
	double temperatureRange = 40;//max(abs(bottomTemperature - topTemperature), abs(topTemperature));
	if(temperatureRange == 0)temperatureRange = 1;

	if (maxHeight == 0)
		return;

	HBRUSH brush;
	int h;
	int topT, bottomT;
	int rightMargin = 40;
	RECT rect;
	CLayer *layer;

	
	HPEN pen = CreatePen(0, 1, 0);
	//HPEN boldPen = CreatePen(0, 3, 0);
	HPEN oldPen = (HPEN)SelectObject(hdc, pen);
	HPEN dotPen = CreatePen(PS_DASH, 1, RGB(0,0,0));

	LOGFONT lFont;
	ZeroMemory(&lFont, sizeof(lFont));
	lFont.lfHeight = 16;
	lFont.lfWeight = FW_BOLD;
	wcscpy_s(lFont.lfFaceName, WINDOW_FONT);
	HFONT font = CreateFontIndirect(&lFont);
	HFONT oldFont = SelectFont(hdc, font);
		
	SetBkMode(hdc, TRANSPARENT);

	int dy = 0;
	for (int l = 0; l < CSnow::current()->getLayersNum(); l++) {
		layer = CSnow::current()->getLayer(l);
		//if (type)h = height*CSnow::current()->getLayer(l)->GetHeight(t)/maxHeight;
		//else h = height*CSnow::current()->getLayer(l)->GetDensity(t)/maxHeight;
		h = (int)(height*layer->GetHeight()/maxHeight);

		if (h == 0)
			continue;

		//draw layer
		brush = CreateSolidBrush((type) ? layer->GetParticleColor() : layer->GetDensityColor());
		rect.left = x; rect.right = x + width - rightMargin;
		rect.top = y + height - dy - (int)h; rect.bottom = y + height - dy;
		FillRect(hdc, &rect, brush);
		DeleteObject(brush);

		//draw layer temperature
		topT = (int)((width - rightMargin)*layer->GetTopTemperature()/temperatureRange);
		bottomT = (int)((width - rightMargin)*layer->GetBottomTemperature()/temperatureRange);
		SelectObject(hdc, dotPen);
		SetBkMode(hdc, OPAQUE);
		MoveToEx(hdc, x + width - rightMargin + topT - 1, rect.top, NULL);
		LineTo(hdc, x + width - rightMargin + bottomT - 1, rect.bottom);
		SetBkMode(hdc, TRANSPARENT);
		SelectObject(hdc, pen);

		if(layer->GetSelection()) {
			HPEN boldPen = CreatePen(0, 3, ((type) ? layer->GetParticleSelectionColor() : 0));
			SelectObject(hdc, boldPen);
			MoveToEx(hdc, rect.left + 1, rect.top + 1, NULL);
			LineTo(hdc, rect.left + 1, rect.bottom - 1);
			LineTo(hdc, rect.right - 2, rect.bottom - 1);
			LineTo(hdc, rect.right - 2, rect.top + 1);
			LineTo(hdc, rect.left + 1, rect.top + 1);
			SelectObject(hdc, pen);
			DeleteObject(boldPen);
		}
		
		MoveToEx(hdc, x + width - rightMargin + 10, rect.top, NULL);
		LineTo(hdc, x + width - rightMargin + 10, rect.bottom);
		
		TEXTMETRIC tMetric;
		GetTextMetrics(hdc, &tMetric);
		if (h > tMetric.tmHeight/2) {
			SetTextAlign(hdc, TA_LEFT);
			SetTextColor(hdc, 0x0);
			TextOut(hdc, x + width - rightMargin + 14, (rect.bottom + rect.top)/2 - tMetric.tmHeight/2, layer->ToString(CLayer::HEIGHT, 4).c_str(), layer->ToString(CLayer::HEIGHT, 4).size());
			SetTextAlign(hdc, TA_CENTER);
			SetTextColor(hdc, 0xffffff);
			TextOut(hdc, (x + width - rightMargin)/2, (rect.bottom + rect.top)/2 - tMetric.tmHeight/2, layer->ToString((type) ? CLayer::PARTICLE : CLayer::DENSITY, 4).c_str(), layer->ToString((type) ? CLayer::PARTICLE : CLayer::DENSITY, 4).size());
		}
		
		dy += h;
		MoveToEx(hdc, x, y + height - dy, NULL);
		LineTo(hdc, x + width - rightMargin + 16, y + height - dy);

		//draw grid
		MoveToEx(hdc, x, y + height - dy + 3, NULL);
		LineTo(hdc, x, y + height - dy - 3);
		MoveToEx(hdc, x + (width - rightMargin)/4, y + height - dy + 3, NULL);
		LineTo(hdc, x + (width - rightMargin)/4, y + height - dy - 3);
		MoveToEx(hdc, x + (width - rightMargin)/2, y + height - dy + 3, NULL);
		LineTo(hdc, x + (width - rightMargin)/2, y + height - dy - 3);
		MoveToEx(hdc, x + (width - rightMargin)/4*3, y + height - dy +3, NULL);
		LineTo(hdc, x + (width - rightMargin)/4*3, y + height - dy - 3);
		MoveToEx(hdc, x + (width - rightMargin) - 1, y + height - dy + 3, NULL);
		LineTo(hdc, x + (width - rightMargin) - 1, y + height - dy - 3);
//.........这里部分代码省略.........
开发者ID:Sergiomi,项目名称:white_monster,代码行数:101,代码来源:SnowModelLayers.cpp


示例5: if

void CtrlDisAsmView::drawBranchLine(HDC hdc, std::map<u32,int>& addressPositions, BranchLine& line)
{
	HPEN pen;
	u32 windowEnd = manager.getNthNextAddress(windowStart,visibleRows);
	
	int topY;
	int bottomY;
	if (line.first < windowStart)
	{
		topY = -1;
	} else if (line.first >= windowEnd)
	{
		topY = rect.bottom+1;
	} else {
		topY = addressPositions[line.first] + rowHeight/2;
	}
			
	if (line.second < windowStart)
	{
		bottomY = -1;
	} else if (line.second >= windowEnd)
	{
		bottomY = rect.bottom+1;
	} else {
		bottomY = addressPositions[line.second] + rowHeight/2;
	}

	if ((topY < 0 && bottomY < 0) || (topY > rect.bottom && bottomY > rect.bottom))
	{
		return;
	}

	// highlight line in a different color if it affects the currently selected opcode
	if (line.first == curAddress || line.second == curAddress)
	{
		pen = CreatePen(0,0,0x257AFA);
	} else {
		pen = CreatePen(0,0,0xFF3020);
	}
	
	HPEN oldPen = (HPEN) SelectObject(hdc,pen);
	int x = pixelPositions.arrowsStart+line.laneIndex*8;

	if (topY < 0)	// first is not visible, but second is
	{
		MoveToEx(hdc,x-2,bottomY,0);
		LineTo(hdc,x+2,bottomY);
		LineTo(hdc,x+2,0);

		if (line.type == LINE_DOWN)
		{
			MoveToEx(hdc,x,bottomY-4,0);
			LineTo(hdc,x-4,bottomY);
			LineTo(hdc,x+1,bottomY+5);
		}
	} else if (bottomY > rect.bottom) // second is not visible, but first is
	{
		MoveToEx(hdc,x-2,topY,0);
		LineTo(hdc,x+2,topY);
		LineTo(hdc,x+2,rect.bottom);
				
		if (line.type == LINE_UP)
		{
			MoveToEx(hdc,x,topY-4,0);
			LineTo(hdc,x-4,topY);
			LineTo(hdc,x+1,topY+5);
		}
	} else { // both are visible
		if (line.type == LINE_UP)
		{
			MoveToEx(hdc,x-2,bottomY,0);
			LineTo(hdc,x+2,bottomY);
			LineTo(hdc,x+2,topY);
			LineTo(hdc,x-4,topY);
			
			MoveToEx(hdc,x,topY-4,0);
			LineTo(hdc,x-4,topY);
			LineTo(hdc,x+1,topY+5);
		} else {
			MoveToEx(hdc,x-2,topY,0);
			LineTo(hdc,x+2,topY);
			LineTo(hdc,x+2,bottomY);
			LineTo(hdc,x-4,bottomY);
			
			MoveToEx(hdc,x,bottomY-4,0);
			LineTo(hdc,x-4,bottomY);
			LineTo(hdc,x+1,bottomY+5);
		}
	}

	SelectObject(hdc,oldPen);
	DeleteObject(pen);
}
开发者ID:Alwayssnarky,项目名称:ppsspp,代码行数:93,代码来源:CtrlDisAsmView.cpp


示例6: RenderOffscreen

void RenderOffscreen(HDC hDestDC)
{
	HDC hdc				= hDestDC; // CreateCompatibleDC(hWndMain);
	int err=GetLastError();
	HBITMAP hOldBitmap	= SelectObject(hdc, hbmpOffscreen);
	RECT rect;
	HPEN hPen;
	double dx, dy, px, py,  AngRad, dDeltaAng;
	int pos, p1;
	long CenterX, CenterY;

	hPen = SelectObject(hdc, CreatePen(PS_SOLID, 3, 0L));

	GetClientRect(hWndMain, &rect);

	/* Draw the table */
	CenterX = (rect.right - rect.left)/2;
	CenterY = (rect.bottom - rect.top)/2;
	Ellipse(hdc, CenterX - 100, CenterY - 100, CenterX + 100, CenterY + 100);

	/* Draw the chopsticks */
	dDeltaAng = 360 / PHILOSOPHERS;
	for (pos = 0; pos < PHILOSOPHERS; pos++)	//FIXIT
	{
		/* Draw the chopsticks */
		AngRad = (pos * dDeltaAng)/57.29577951;
		dx = CenterX + (sin(AngRad)*60);
		dy = CenterY - (cos(AngRad)*60);
		MoveToEx(hdc, (int)dx, (int)dy, NULL);
		dx = CenterX + (sin(AngRad)*85);
		dy = CenterY - (cos(AngRad)*85);
		LineTo(hdc, (int)dx, (int)dy);

		//Draw the plate
		AngRad = ((pos * dDeltaAng+dDeltaAng / 2))/57.29577951;
		dx = CenterX + (sin(AngRad) * 72);
		dy = CenterY - (cos(AngRad) * 72);
		Ellipse(hdc, (int)dx-12, (int)dy-12, (int)dx+12, (int)dy+12);
	}

	/* delete the black pen */
	DeleteObject(SelectObject(hdc, hPen));

	/* Draw the philosophers */
	for(pos = 0; pos < PHILOSOPHERS; pos++)
	{
		/* select a pen for each philosopher */
		switch (gDinerState[pos])
		{
		case RESTING:
			hPen = SelectObject(hdc, CreatePen(PS_SOLID, 3, RGB(0, 255, 0)));
			break;

		case WAITING:
		case EATING:
			hPen = SelectObject(hdc, CreatePen(PS_SOLID, 3, RGB(255, 0, 0)));
			break;

		default:
			hPen = SelectObject(hdc, CreatePen(PS_SOLID, 3, 0L));
		}

		AngRad = ((pos * dDeltaAng) + dDeltaAng / 2)/57.29577951;
		px = CenterX + (sin(AngRad)*150);
		py = CenterY - (cos(AngRad)*150);

		/* Draw the Philosopher */
		Ellipse(hdc, (int)px-25, (int)py-25, (int)px+25, (int)py+25);

		//Draw the left arm
		if (gChopstickState[pos] == pos)
		{
			MoveToEx(hdc, (int)px, (int)py, NULL);
			AngRad = (pos * dDeltaAng)/57.29577951;
			dx = CenterX + (sin(AngRad)*85);
			dy = CenterY - (cos(AngRad)*85);
			LineTo(hdc, (int)dx, (int)dy);
		}

		//Draw the right arm
		p1 = pos + 1;
		if (p1 == PHILOSOPHERS)
			p1 = 0;
		if (gChopstickState[p1] == pos)
		{
			MoveToEx(hdc, (int)px, (int)py, NULL);
			AngRad = (p1 * dDeltaAng)/57.29577951;
			dx = CenterX + (sin(AngRad)*85);
			dy = CenterY - (cos(AngRad)*85);
			LineTo(hdc, (int)dx, (int)dy);
		}

		/* Delete the pen */
		DeleteObject(SelectObject(hdc, hPen));			
	}	//for pos

	BitBlt( hDestDC,
				rect.left,
				rect.top,
				rect.right - rect.left,
//.........这里部分代码省略.........
开发者ID:zengboming,项目名称:LAN-Communications-Guardian,代码行数:101,代码来源:DINING.C


示例7: draw_meter

void draw_meter(THRESHOLDOBJ * st)
{
	PAINTSTRUCT ps;
	HDC hdc;
	char szdata[20];
	RECT rect;
	int  act,width,mid,height,bottom,y1,y2;
	HBRUSH actbrush,bkbrush;
	HPEN bkpen;
	float min, max;

	
	GetClientRect(st->displayWnd, &rect);
	//width=rect.right>>1;
	width=(int)((float)rect.right/200.0f*st->barsize);
	mid=rect.right>>1;
    	
	min=st->in_ports[0].in_min;
	max=st->in_ports[0].in_max;

	hdc = BeginPaint (st->displayWnd, &ps);
	bottom=rect.bottom-10;
	height=(bottom-rect.top-20);

    act=bottom-(int)(size_value(min,max,st->gained_value,0.0f,(float)height,0));
	y1 =bottom-(int)(size_value(min,max,(float)st->from_input,0.0f,(float)height,0));
	y2 =bottom-(int)(size_value(min,max,(float)st->to_input,0.0f,(float)height,0));

	if (act>bottom) act=bottom;
	if (act<bottom-height) act=bottom-height;

	actbrush=CreateSolidBrush(st->color);
    bkbrush=CreateSolidBrush(st->bkcolor);
	bkpen =CreatePen (PS_SOLID,1,st->bkcolor);
	if (st->redraw) FillRect(hdc, &rect,bkbrush);
    
   	SelectObject (hdc, bkpen);		
   	SelectObject (hdc, bkbrush);
	if (st->bigadapt)
	{
		Rectangle(hdc,15,st->old_y1,50,st->old_y1+15);
		MoveToEx(hdc,5, st->old_y1,NULL);	
		LineTo(hdc,rect.right, st->old_y1);
	}

	if (st->smalladapt)
	{
		Rectangle(hdc,15,st->old_y2,50,st->old_y2+15);
		MoveToEx(hdc,5, st->old_y2,NULL);	
		LineTo(hdc,rect.right, st->old_y2);
	}

	if ((st->last_value<act)&&(!st->redraw)) 
	{
			SelectObject (hdc, bkbrush);		
			Rectangle(hdc,mid-width,st->last_value,mid+width,act);
	}
	else
	{
			SelectObject (hdc, actbrush);
			Rectangle(hdc,mid-width,bottom,mid+width,act);
	}

	if ((st->fontsize>0))
	{
		RECT txtpos;int x;
		SelectObject(hdc, st->font);
		SetBkMode(hdc, OPAQUE);
		SetBkColor(hdc, st->fontbkcolor);
		SetTextColor(hdc,st->fontcolor);

		//wsprintf(szdata, "%d   ",(int)(st->gained_value+0.5f));
		//ExtTextOut( hdc, rect.right-40,10, 0, &rect,szdata, strlen(szdata), NULL ) ;

		txtpos.left=5;txtpos.right=50;
		txtpos.top=0;txtpos.bottom=0;
		sprintf(szdata, " %.2f ",st->from_input);
		DrawText(hdc, szdata, -1, &txtpos, DT_CALCRECT);
		x=txtpos.bottom;
		txtpos.top=y1-x;txtpos.bottom=txtpos.top+x;
		DrawText(hdc, szdata, -1, &txtpos, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
	

		txtpos.left=5;txtpos.right=50;
		txtpos.top=0;txtpos.bottom=0;
		sprintf(szdata, " %.2f ",st->to_input);
		DrawText(hdc, szdata, -1, &txtpos, DT_CALCRECT);
		txtpos.top=y2+1;txtpos.bottom+=y2+1;
		DrawText(hdc, szdata, -1, &txtpos, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
		
	}
	
	SelectObject (hdc, DRAW.pen_ltblue);		
	MoveToEx(hdc,5, y1,NULL);	
	LineTo(hdc,rect.right, y1);
	st->old_y1=y1;

	MoveToEx(hdc,5, y2,NULL);	
	LineTo(hdc,rect.right, y2);
	st->old_y2=y2;
//.........这里部分代码省略.........
开发者ID:Smeetal,项目名称:BrainBay,代码行数:101,代码来源:ob_threshold.cpp


示例8: MoveToEx

void Graphics::moveTo(int x, int y)
{
  MoveToEx(m_dc->m_dc, x, y, NULL);
}
开发者ID:kaseya,项目名称:tightvnc2,代码行数:4,代码来源:Graphics.cpp


示例9: max

void CEditView::Draw( HDC hDC, LPRECT prcClipBox, CSelection *pSel ) const
{
	// prcClipBox is control-relative, not view-relative
	int nRowStart = ( max( m_rcView.top, prcClipBox->top ) - m_rcView.top ) / m_cyLine;
	int ySnap = m_rcView.top + nRowStart * m_cyLine;
	nRowStart += m_nTopIndex;
	int nRowEnd = m_nTopIndex + ( min( prcClipBox->bottom, m_rcView.bottom ) - m_rcView.top ) / m_cyLine;

//#define _DRAWCHARGRID
#ifdef _DRAWCHARGRID
	{
	RECT rc;
	if ( IntersectRect( &rc, prcClipBox, &m_rcView ) )
	{
		rc.left = GetLeftMargin( TRUE, TRUE );
		HPEN hPen = CreatePen( PS_SOLID, 0, RGB( 192, 192, 192 ) );
		HPEN hPenOld = ( HPEN ) SelectObject( hDC, hPen );
		int xStart = m_rcView.left + GetLeftMargin( TRUE, TRUE ) +
					 ( ( prcClipBox->left - m_rcView.left ) / m_cxChar ) * m_cxChar;
		int xEnd = min( prcClipBox->right, m_rcView.right );
		int yStart = ySnap;
		int yEnd = min( prcClipBox->bottom, m_rcView.bottom );
		for ( int y = yStart; y <= yEnd; y += m_cyLine )
		{
			MoveToEx( hDC, rc.left, y, NULL );
			LineTo( hDC, rc.right, y );
		}
		for ( int x = xStart; x <= xEnd; x += m_cxChar )
		{
			MoveToEx( hDC, x, rc.top, NULL );
			LineTo( hDC, x, rc.bottom );
		}
		SelectObject( hDC, hPenOld );
		DeleteObject( hPen );
	}
	}
#endif

	int nLastLine = m_pBuffer->GetLineCount() - 1;
	nLastLine = min( nLastLine, nRowEnd );
	int nSelStartCol, nSelStartRow, nSelEndCol, nSelEndRow;
	BOOL bColumnSel = FALSE;
	int cxCaret = 0;
	if ( pSel )
	{
		pSel->GetNormalizedViewSelection( nSelStartCol, nSelStartRow, nSelEndCol, nSelEndRow );
		bColumnSel = pSel->IsColumnSel();
		cxCaret = pSel->GetCaretWidth();
	}

	int cxLeftMargin1 = GetLeftMargin( FALSE );
	COLORREF crVDividerLines = m_pCtrl->GetVDividerLineColor();

	// draw the left margin in a different color
	if ( cxLeftMargin1 )
	{
		COLORREF crMargin = m_pCtrl->GetLeftMarginColor();
		if ( crMargin != CLR_INVALID )
		{
			RECT rc = m_rcView;
			rc.right = rc.left + cxLeftMargin1;
			SetBkColor( hDC, crMargin );
			ExtTextOut( hDC, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL );
		}
	}

	// draw the line numbers in a different color
	int cxLeftMargin2 = GetLeftMargin( TRUE );
	if ( cxLeftMargin2 != cxLeftMargin1 )
	{
		COLORREF crLineNumbers = m_pCtrl->GetLineNumberBackColor();
		if ( crLineNumbers != CLR_INVALID )
		{
			RECT rc = m_rcView;
			rc.left = m_rcView.left + cxLeftMargin1;
			rc.right = m_rcView.left + cxLeftMargin2;
			SetBkColor( hDC, crLineNumbers );
			ExtTextOut( hDC, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL );
		}
	}

	// draw the divider lines
	if ( crVDividerLines != CLR_INVALID )
	{
		if ( cxLeftMargin1 )
			DrawVDividerLine( hDC, m_rcView, m_rcView.left + cxLeftMargin1 );
		if ( cxLeftMargin1 != cxLeftMargin2 )
			DrawVDividerLine( hDC, m_rcView, m_rcView.left + cxLeftMargin2 );
	}

	int cxLeftMargin3 = GetLeftMargin( TRUE, TRUE );

	// draw the stuff in the left margin in one pass, rather than with each
	// line.  This is much faster.
	int y = ySnap;
	int xLineNumber = m_rcView.left + cxLeftMargin1;
	int nLineNumRadix;
	BOOL bLineNumbers;

	// if line numbering, select the font once, or else things slow down a bit
//.........这里部分代码省略.........
开发者ID:ForbiddenEra,项目名称:kx-audio-driver,代码行数:101,代码来源:EDITVIEW.CPP


示例10: NumKeys

int		LinkTimeControl::PaintFCurves( ParamDimensionBase *dim, HDC hdc, Rect& rcGraph, Rect& rcPaint,
			float tzoom, int tscroll, float vzoom, int vscroll, DWORD flags )
{
	const int n = NumKeys();
	if ( n == 0 )
		return 0;

	Interval valid;
	int h = rcGraph.h()-1;
	HPEN dpen,spen;
	BOOL init=FALSE;		
	Interval range = GetTimeRange(TIMERANGE_ALL);	
	SetBkMode(hdc,TRANSPARENT);	

	dpen = CreatePen(PS_DOT,0,GetColorManager()->GetColor(kFunctionCurveFloat));
	spen = CreatePen(PS_SOLID,0,GetColorManager()->GetColor(kFunctionCurveFloat));

	SIZE size;
	GetTextExtentPoint( hdc, _T("0"), 1, &size );

	float val;
	TimeValue leftTime = ScreenToTime(rcPaint.left,tzoom,tscroll);
	TimeValue rightTime = ScreenToTime(rcPaint.right,tzoom,tscroll);
	int x, y;

	// dotted line to left of keys
	if ( leftTime < range.Start() )
	{
		SelectObject(hdc,dpen);
		GetValue(range.Start(),&val,valid);
		y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
		MoveToEx(hdc,rcPaint.left,y,NULL);
		LineTo(hdc,TimeToScreen(range.Start(),tzoom,tscroll),y);
	}

	SelectObject(hdc,spen);

	// first node text
	{
		TimeValue t = GetKeyTime( 0 );
		if ( t >= leftTime && t <= rightTime )
		{
			GetValue(t,&val,valid);
			y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
			x = TimeToScreen(t,tzoom,tscroll);
			INode* node = fOwner->GetNode( 0 );
			DLTextOut( hdc, x, y-1-size.cy, node ? node->GetName() : _T("World") );
		}
	}

	// solid line between keys
	for ( int i=1; i<n; ++i )
	{
		TimeValue t0 = GetKeyTime( i-1 );
		TimeValue t1 = GetKeyTime( i );
		if ( t1 < leftTime || t0 > rightTime )
			continue;
		GetValue(t0,&val,valid);
		y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
		MoveToEx(hdc,TimeToScreen(t0,tzoom,tscroll),y,NULL);
		x = TimeToScreen(t1,tzoom,tscroll);
		LineTo(hdc,x,y);
		GetValue(t1,&val,valid);
		y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
		LineTo(hdc,x,y);

		INode* node = fOwner->GetNode( i );
		DLTextOut( hdc, x, y-1-size.cy, node ? node->GetName() : _T("World") );
	}

	// dotted line to right of keys
	if ( rightTime > range.End() )
	{
		SelectObject(hdc,dpen);
		GetValue(range.End(),&val,valid);
		y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
		MoveToEx(hdc,TimeToScreen(range.End(),tzoom,tscroll),y,NULL);
		LineTo(hdc,rcPaint.right,y);
	}

	SelectObject( hdc, spen );
	HBRUSH hUnselBrush = CreateSolidBrush(GetColorManager()->GetColor(kTrackbarKeys));
	HBRUSH hSelBrush = CreateSolidBrush(GetColorManager()->GetColor(kTrackbarSelKeys));

	// render keys themselves
	for ( int i=0; i<n; ++i )
	{
		TimeValue t = GetKeyTime( i );
		if ( t < leftTime || t > rightTime )
			continue;
		GetValue(t,&val,valid);
		y = ValueToScreen(dim->Convert(val),h,vzoom,vscroll);
		x = TimeToScreen(t,tzoom,tscroll);
		SelectObject( hdc, IsKeySelected( i ) ? hSelBrush : hUnselBrush );
		Rectangle(hdc,x-3,y-3,x+3,y+3);
	}

	SetBkMode(hdc,OPAQUE);
	SelectObject(hdc,GetStockObject(BLACK_PEN));	

//.........这里部分代码省略.........
开发者ID:artemeliy,项目名称:inf4715,代码行数:101,代码来源:link_timectrl.cpp


示例11: SetBkColor


//.........这里部分代码省略.........
			nViewColEnd = min( nRightIndex, nViewColEnd );
			nViewColEnd = max( m_nLeftIndex, nViewColEnd );

			clrLine[ nColors ] = MAKELPARAM( nViewColEnd - m_nLeftIndex, ( WORD ) CBuffer::eText );
		}

		//////////////////////////////////////////////////////////////////////////
		// Step 3: Output the line
		//
		ASSERT( nColors );
		BOOL bFirstToken = TRUE;

		for ( int i = 0; i < nColors; i++ )
		{
			DWORD dwColorInfo = clrLine[ i ];
			CBuffer::LangToken eToken = ( CBuffer::LangToken ) HIWORD( dwColorInfo );
			SetTextColor( hDC, m_pCtrl->GetTokenColor( eToken, TRUE ) );
			COLORREF crBk = bHighlight ? m_pCtrl->GetHighlightedLineColor() : m_pCtrl->GetTokenColor( eToken, FALSE );
			if ( crBk != CLR_INVALID )
			{
				SetBkColor( hDC, crBk );
				SetBkMode( hDC, OPAQUE );
			}
			else
			{
				SetBkMode( hDC, TRANSPARENT );
			}

			long cxExtraSpacing, cyDescentShift;
			SelectObject( hDC, m_pCtrl->GetTokenFont( eToken, cxExtraSpacing, cyDescentShift, m_pCtrl->m_font ) );
			SetTextCharacterExtra( hDC, cxExtraSpacing );

			int nTokenStart = LOWORD( dwColorInfo );
			int nTokenNext = LOWORD( clrLine[ i + 1 ] );
			int cbToken = nTokenNext - nTokenStart;
			if ( cbToken )
			{
				#ifndef _UNICODE
				// The first visible token on the left of the line might be cutoff right
				// in the middle of a multi-byte char.  We need to account for this by not
				// rendering the character (just leave whitespace).
				if ( bFirstToken && _ismbstrail( ( const unsigned char * ) pszLineStart, ( const unsigned char * ) pszStart ) )
				{
					// scan backwards to the lead byte
					LPCTSTR pszLead = pszStart;
					while ( _ismbstrail( ( const unsigned char * ) pszLineStart, ( const unsigned char * ) --pszLead ) )
						;
					int cbChar = pszStart - pszLead;
					nTokenStart += cbChar;
					cbToken -= cbChar;
					x += ( cbChar * m_cxChar );
				}
				#endif
				bFirstToken = FALSE;
				ExtTextOut( hDC, x, y - cyDescentShift, 0, NULL, szLine + nTokenStart, cbToken, NULL );
				x += ( cbToken * m_cxChar );
			}
			// don't worry about deselecting the font -- it will be cleaned up by any
			// calling method (as an optimization)
		}
	}

	//////////////////////////////////////////////////////////////////////////
	// Step 4: give the parent window a crack at painting, too.
	//
	DWORD dwStyle = m_pBuffer->GetLineStyle( nLine );
	if ( HAS_FLAG( dwStyle, CML_OWNERDRAW ) )
	{
		CM_DRAWLINEDATA dld;
		dld.hDC = hDC;
		dld.rcLine.left = xLeft;
		dld.rcLine.top = y;
		dld.rcLine.right = m_rcView.right;
		dld.rcLine.bottom = y + m_cyLine;
		dld.nLine = nLine;
		dld.nLeftCol = m_nLeftIndex; 
		dld.nRightCol = m_nRightIndex; 
		dld.lParam = m_pBuffer->GetItemData( nLine );
		dld.dwStyle = dwStyle;
		m_pCtrl->NotifyParent( CMN_DRAWLINE, ( NMHDR * ) &dld );
	}

	// Draw divider line underneath the line if appropriate
	if ( m_pBuffer->HasDivider( nLine ) )
	{
		COLORREF crDividerLine = m_pCtrl->GetHDividerLineColor();
		COLORREF crWindow = m_pCtrl->GetWindowColor( TRUE );
		// if line will blend in with the background, make it visible (opposite of window color).
		if ( crDividerLine == CLR_INVALID || crDividerLine == crWindow )
			crDividerLine = ( ~crWindow & 0x00ffffff );

		HPEN hPen = CreatePen( PS_SOLID, CY_DIVIDERLINE, crDividerLine );
		HPEN hPenOld = ( HPEN ) SelectObject( hDC, hPen );
		int yLine = y + m_cyLine - 1;
		MoveToEx( hDC, xDividerStart, yLine, NULL );
		LineTo( hDC, m_rcView.right, yLine );
		SelectObject( hDC, hPenOld );
		DeleteObject( hPen );
	}
}
开发者ID:ForbiddenEra,项目名称:kx-audio-driver,代码行数:101,代码来源:EDITVIEW.CPP


示例12: myDrawAxesSprite

static void myDrawAxesSprite( const ON_Viewport& viewport, HDC hdc )
{
  // Use simple Windows calls to draw world axes sprite in lower left corner.
  // Note that Windows has screen (0,0) in the upper left corner; i.e,
  // screen "y" increases downwards.
  if ( !hdc )
    return;
  const int axes_size = 30;

  int port_left, port_right, port_top, port_bottom;
  if ( !viewport.GetScreenPort( &port_left, &port_right, &port_bottom, &port_top, NULL, NULL ) )
    return;
  const int scr_width  = port_right - port_left; // no "+1" here
  const int scr_height = port_bottom - port_top; // no "+1" here

  if (4*axes_size >= scr_width )
    return;
  if (4*axes_size >= scr_height )
    return;

  int x0 = 3*axes_size/2;
  int y0 = port_bottom - 3*axes_size/2;
  int indx[3] = {0,1,2};
  double scr_coord[3][2];
  viewport.GetCoordinateSprite( axes_size, x0, y0, indx, scr_coord );

#define LXSIZE 3
#define LYSIZE 3
#define LOFF 3

  // draw 3 axes from back to front
  HPEN axis_pen[3];
  axis_pen[0] = CreatePen( PS_SOLID, 2, RGB(255,0,0) );
  axis_pen[1] = CreatePen( PS_SOLID, 2, RGB(0,255,0) );
  axis_pen[2] = CreatePen( PS_SOLID, 2, RGB(0,0,255) );
  HGDIOBJ saved_pen = SelectObject( hdc, axis_pen[0] );

  int i, k, x, y, lx, ly;
  for (i=0;i<3;i++) {
    k = indx[i];
    x = (int)scr_coord[k][0];
    y = (int)scr_coord[k][1];
    // use direction of screen vector to determine letter placement
    lx = x-x0; ly = y-y0;
    if (abs(lx) > abs(ly)) {
      // center letter to right/left of axis end
      lx = (x >= x0) ? x + LXSIZE+LOFF : x - LXSIZE-LOFF;
      ly = y;
    }
    else if (abs(ly) > abs(lx)) {
      // center letter above/below axis end
      lx = x;
      ly = (y >= y0) ? y + LYSIZE+LOFF : y - LYSIZE-LOFF;
    }
    else if (lx) {
      // diagonal axis - center letter on axis
      lx = (x >= x0) ? x + LXSIZE+LOFF : x - LXSIZE-LOFF;
      ly = (y >= y0) ? y + LYSIZE+LOFF : y - LYSIZE-LOFF;
    }
    else {
      // axis is perp to screen - center letter at axis end
      lx = x;
      ly = y;
    }
    SelectObject( hdc, axis_pen[k] );

    // draw axis
    MoveToEx( hdc, x0, y0, NULL );
    LineTo( hdc, x, y );

    // draw axis label
    switch (k) {
    case 0: // X
      MoveToEx( hdc, lx-LXSIZE, ly-LYSIZE, NULL );
      LineTo(   hdc, lx+LXSIZE, ly+LYSIZE );
      MoveToEx( hdc, lx-LXSIZE, ly+LYSIZE, NULL );
      LineTo(   hdc, lx+LXSIZE, ly-LYSIZE );
      break;
    case 1: // Y
      MoveToEx( hdc, lx-LXSIZE, ly-LYSIZE, NULL );
      LineTo(   hdc, lx,    ly    );
      LineTo(   hdc, lx+LXSIZE, ly-LYSIZE );
      MoveToEx( hdc, lx,    ly, NULL    );
      LineTo(   hdc, lx,    ly+LYSIZE );
      break;
    case 2: // Z
      MoveToEx( hdc, lx-LXSIZE, ly-LYSIZE, NULL );
      LineTo(   hdc, lx+LXSIZE, ly-LYSIZE );
      LineTo(   hdc, lx-LXSIZE, ly+LYSIZE );
      LineTo(   hdc, lx+LXSIZE, ly+LYSIZE );
      break;
    }

  }
  SelectObject( hdc, saved_pen );
  DeleteObject( axis_pen[0] );
  DeleteObject( axis_pen[1] );
  DeleteObject( axis_pen[2] );

#undef LXSIZE
//.........这里部分代码省略.........
开发者ID:Arecius,项目名称:opennurbs,代码行数:101,代码来源:example_gl.cpp


示例13: draw_stat_chart

//绘制实验统计数据图表
void draw_stat_chart(PHISTORY history, RECT &rect, int max_round, int min_round, double max_value, double min_value, int type)
{
	int x = type == 0 ? rect.left : rect.right;
	if(type < 2)
	{
		draw_line(x, rect.top, x, rect.bottom);
	}

	int h = (rect.bottom - rect.top) / DRAW_STAT_TAG_NUM;
	x += type == 0 ? -DRAW_STAT_TAG_LEN : DRAW_STAT_TAG_LEN;
	int y = rect.bottom;
	double value = (max_value - min_value) / DRAW_STAT_TAG_NUM;
	char buf[MAX_LOADSTRING];
	for(int i=0;i<=DRAW_STAT_TAG_NUM;i++)
	{
		if(type < 2)
		{
			draw_line(x, y, type == 0 ? rect.left : rect.right, y);
		}
		sprintf_s(buf, sizeof(buf), "%.1f", min_value +  value * i);
		switch(type)
		{
		case 0:
			{
				RECT r = {gDrawClientRect.left, y - h, x, y};
				DrawText(gDrawBmpMemDC, buf, (int)strlen(buf), &r, DT_RIGHT | DT_BOTTOM | DT_SINGLELINE);
			}
			break;
		case 1:
			{
				RECT r = {x, y - h, gDrawClientRect.right, y};
				DrawText(gDrawBmpMemDC, buf, (int)strlen(buf), &r, DT_LEFT | DT_BOTTOM | DT_SINGLELINE);
			}
			break;
		default:
			if(i > 0)
			{
				RECT r = {x, y, gDrawClientRect.right, y + h};
				DrawText(gDrawBmpMemDC, buf, (int)strlen(buf), &r, DT_LEFT | DT_TOP | DT_SINGLELINE);
			}
			break;
		}
		y -= h;
	}

	PHISTORYITEM p = history->head;
	int height = rect.bottom - rect.top;
	int width = rect.right - rect.left;
	const int cr = type == 0 ? 4 : 3;
	int i = 0;
	while(p != NULL)
	{
		x = rect.left + width * (p->round - min_round) / (max_round - min_round);
		switch(type)
		{
		case 0:
			y = rect.bottom - (int)(height * (p->top[0].generation - min_value) / (max_value - min_value));
			break;
		case 1:
			value = (double)p->round / p->top[0].generation;
			y = rect.bottom - (int)(height * (value - min_value) / (max_value - min_value));
			break;
		default:
			value = (double)p->top[0].score / gConfig.lab_more_count;
			y = rect.bottom - (int)(height * (value - min_value) / (max_value - min_value));
			break;
		}
		if(i > 0)
		{
			LineTo(gDrawBmpMemDC, x, y);
		}
		else
		{
			MoveToEx(gDrawBmpMemDC, x, y, NULL);
			Ellipse(gDrawBmpMemDC, x-cr, y-cr, x+cr, y+cr);
		}

		i++;
		p = p->next;
	}
	if(i > 1)
	{
		Ellipse(gDrawBmpMemDC, x-cr, y-cr, x+cr, y+cr);
	}

	switch(type)
	{
	case 0:
		{
			RECT r = {rect.left, gDrawClientRect.top, rect.right/3, rect.top};
			sprintf_s(buf, sizeof(buf), "%s", "—— 子代");
			DrawText(gDrawBmpMemDC, buf, (int)strlen(buf), &r, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
		}
		break;
	case 1:
		{
			RECT r = {rect.right/3, gDrawClientRect.top, rect.right*2/3, rect.top};
			sprintf_s(buf, sizeof(buf), "%s", "—— 代比");
			DrawText(gDrawBmpMemDC, buf, (int)strlen(buf), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
//.........这里部分代码省略.........
开发者ID:hedane,项目名称:HHCARobot,代码行数:101,代码来源:draw.cpp


示例14: switch

INT_PTR CKeyProp::OnReceiveMsg(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
    static COLORREF acrCustomClr[16];

    switch (msg)
    {
        case WM_DRAWITEM:

            // Paint the color swatch
            if (wParam == IDC_KEY_COLOR)
            {
                DRAWITEMSTRUCT *pDraw = (DRAWITEMSTRUCT*)lParam;
            
                if (IsWindowEnabled(GetDlgItem(m_hDlg, IDC_KEY_PICK_COLOR)))
                {
                    HBRUSH solidBrush = CreateSolidBrush(m_dwColor);
                    FillRect(pDraw->hDC, &pDraw->rcItem, solidBrush);
                    DeleteObject(solidBrush);
                }
                else  // Color is disabled for this key type
                {
                    // Gray the color swatch
                    FillRect(pDraw->hDC, &pDraw->rcItem, (HBRUSH)GetStockObject(LTGRAY_BRUSH));

                    // 'X' out the swatch
                    MoveToEx(pDraw->hDC, 0, 0, 0);
                    LineTo(pDraw->hDC, pDraw->rcItem.right, pDraw->rcItem.bottom);
                    MoveToEx(pDraw->hDC, pDraw->rcItem.right, 0, 0);
                    LineTo(pDraw->hDC, 0, pDraw->rcItem.bottom);
                }

                FrameRect(pDraw->hDC, &pDraw->rcItem, (HBRUSH)GetStockObject(BLACK_BRUSH));
                return TRUE;
            }

            break;

        case WM_COMMAND:        
            switch (LOWORD(wParam))
            {
                case IDC_KEY_TYPE:
                    if (HIWORD(wParam) == CBN_SELCHANGE)
                    {
                        m_iKey = (int) SendMessage(GetDlgItem(m_hDlg, IDC_KEY_TYPE), 
                                                   CB_GETCURSEL, 0, 0);
                        if (m_iKey== CB_ERR)
                        {
                            m_iKey = DXTKEY_RGB;
                        }

                        UpdateControls();
                        return TRUE;
                    }
                    break;

                case IDC_KEY_PICK_COLOR:
                {
                    CHOOSECOLOR cc;
                
                    ZeroMemory(&cc, sizeof(CHOOSECOLOR));
                    cc.lStructSize = sizeof(CHOOSECOLOR);
                    cc.hwndOwner = m_hDlg;
                    cc.lpCustColors = (LPDWORD)acrCustomClr;
                    cc.Flags = CC_RGBINIT;
                    cc.rgbResult = m_dwColor;
                
                    if (ChooseColor(&cc))
                    {
                        m_dwColor = cc.rgbResult;
                        InvalidateRect(GetDlgItem(hDlg, IDC_KEY_COLOR), 0, FALSE);
                    }
                }

                return TRUE;

            } // inner switch            
            break;
    }

    // default
    return FALSE;
}
开发者ID:chinajeffery,项目名称:dx_sdk,代码行数:82,代码来源:PropSetter.cpp


示例15: draw_line

//画线
void draw_line(int x1, int y1, int x2, int y2)
{
	MoveToEx(gDrawBmpMemDC, x1, y1, NULL);
	LineTo(gDrawBmpMemDC, x2, y2);
}
开发者ID:hedane,项目名称:HHCARobot,代码行数:6,代码来源:draw.cpp


示例16: GetClientRect


//.........这里部分代码省略.........
							br = CreateSolidBrush(colours.selected_background_colour);
						}
						else
						{
							colourfore = colours.selected_text_colour_non_focus;
							br = CreateSolidBrush(colours.selected_background_colour_non_focus);
						}
					}
					else
					{
						colourfore = colours.text_colour;
						br = CreateSolidBrush(colours.background_colour);
					}
					//draw cell background
					//if (!b_themed)
					FillRect(hdc_mem, &draw, br);
				}


				if (br) { DeleteObject(br); br = 0; }

				//render text
				//if (b_themed)
				//	DrawThemeText(m_theme, hdc_mem, LVP_LISTITEM, sel ? (GetFocus() == wnd_playlist ? LIS_SELECTED : LIS_SELECTEDNOTFOCUS) : LIS_NORMAL, L"test", 4, 0, 0, &draw);
				//else
				ui_helpers::text_out_colours_tab(hdc_mem, temp, temp.length(), 2, 1, &draw, sel, colourfore, TRUE, true, (cfg_ellipsis != 0), (ui_helpers::alignment)columns[c]->align);


				if (colours.use_frame_left)
				{
					HPEN pen = CreatePen(PS_SOLID, 1, colours.frame_left);
					HPEN pen_old = (HPEN)SelectObject(hdc_mem, pen);

					MoveToEx(hdc_mem, draw.left, draw.top, 0);
					LineTo(hdc_mem, draw.left, draw.bottom);
					SelectObject(hdc_mem, pen_old);
					DeleteObject(pen);
				}
				if (colours.use_frame_top)
				{
					HPEN pen = CreatePen(PS_SOLID, 1, colours.frame_top);
					HPEN pen_old = (HPEN)SelectObject(hdc_mem, pen);

					MoveToEx(hdc_mem, draw.left, draw.top, 0);
					LineTo(hdc_mem, draw.right, draw.top);
					SelectObject(hdc_mem, pen_old);
					DeleteObject(pen);
				}
				if (colours.use_frame_right)
				{
					HPEN pen = CreatePen(PS_SOLID, 1, colours.frame_right);
					HPEN pen_old = (HPEN)SelectObject(hdc_mem, pen);

					MoveToEx(hdc_mem, draw.right - 1, draw.top, 0);
					LineTo(hdc_mem, draw.right - 1, draw.bottom);
					SelectObject(hdc_mem, pen_old);
					DeleteObject(pen);
				}
				if (colours.use_frame_bottom)
				{
					HPEN pen = CreatePen(PS_SOLID, 1, colours.frame_bottom);
					HPEN pen_old = (HPEN)SelectObject(hdc_mem, pen);

					MoveToEx(hdc_mem, draw.right - 1, draw.bottom - 1, 0);
					LineTo(hdc_mem, draw.left - 1, draw.bottom - 1);
					SelectObject(hdc_mem, pen_old);
开发者ID:9060,项目名称:columns_ui,代码行数:67,代码来源:playlist_view_draw.cpp


示例17: MoveToEx

void TDC::move_to(int x, int y)
//----------------------------
{  MoveToEx(m_hdc,x,y,NULL); }
开发者ID:Artorios,项目名称:rootkit.com,代码行数:3,代码来源:twl.cpp


示例18: MainWndProc


//.........这里部分代码省略.........
				// 获取窗口客户区的DC 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ MoveUp函数代码示例发布时间:2022-05-30
下一篇:
C++ MoveTo函数代码示例发布时间: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