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


C++ NIBLSCALE函数代码示例

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


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

示例1: LatLon2Screen

void MapWindow::DrawTeammate(HDC hdc, RECT rc)
{
  POINT point;

  if (TeammateCodeValid)
    {
      if(PointVisible(TeammateLongitude, TeammateLatitude) )
	{
	  LatLon2Screen(TeammateLongitude, TeammateLatitude, point);

	  SelectObject(hDCTemp,hBmpTeammatePosition);
	  DrawBitmapX(hdc,
		      point.x-NIBLSCALE(10), 
		      point.y-NIBLSCALE(10),
		      20,20,
		      hDCTemp,0,0,SRCPAINT,true);
	
	  DrawBitmapX(hdc,
		      point.x-NIBLSCALE(10), 
		      point.y-NIBLSCALE(10),
		      20,20,
		      hDCTemp,20,0,SRCAND,true);
	}
    }
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:25,代码来源:DrawTeamMate.cpp

示例2: _DrawLine

void MapWindow::DrawHeadUpLine(HDC hdc, POINT Orig, RECT rc, double fMin, double fMax  ) {

  COLORREF rgbCol = RGB_BLACK;
  POINT p1, p2;
  double tmp = fMax*zoom.ResScaleOverDistanceModify();
  
  double trackbearing =  DisplayAircraftAngle+  (DerivedDrawInfo.Heading-DrawInfo.TrackBearing);
  p2.y= Orig.y - (int)(tmp*fastcosine(trackbearing));
  p2.x= Orig.x + (int)(tmp*fastsine(trackbearing));

  p1.y= Orig.y;
  p1.x= Orig.x;

  if (BlackScreen)
  rgbCol = RGB_INVDRAW;

  ForcedClipping=true;
  // Reduce the rectangle for a better effect
  rc.top+=NIBLSCALE(5);
  rc.right-=NIBLSCALE(5);
  rc.bottom-=NIBLSCALE(5);
  rc.left+=NIBLSCALE(5);
  _DrawLine(hdc, PS_SOLID, NIBLSCALE(1), p1, p2, rgbCol, rc);
  ForcedClipping=false;

}
开发者ID:IvanSantanna,项目名称:LK8000,代码行数:26,代码来源:TopView.cpp

示例3: _DrawLine

void MapWindow::DrawCrossHairs(HDC hdc, const POINT Orig,
			       const RECT rc)
{
  POINT o1, o2;
  
  o1.x = Orig.x+NIBLSCALE(20);
  o2.x = Orig.x-NIBLSCALE(20);
  o1.y = Orig.y;
  o2.y = Orig.y;

  if (BlackScreen)
	  _DrawLine(hdc, PS_SOLID, 1, o1, o2, RGB_INVDRAW, rc);
  else
	  _DrawLine(hdc, PS_SOLID, 1, o1, o2, RGB_DARKGREY, rc);

  SetPixel(hdc,o1.x,o1.y,RGB_YELLOW);
  SetPixel(hdc,o2.x,o2.y,RGB_YELLOW);

  o1.x = Orig.x;
  o2.x = Orig.x;
  o1.y = Orig.y+NIBLSCALE(20);
  o2.y = Orig.y-NIBLSCALE(20);

  if (BlackScreen)
	  _DrawLine(hdc, PS_SOLID, 1, o1, o2, RGB_INVDRAW, rc); // 091219
  else
	  _DrawLine(hdc, PS_SOLID, 1, o1, o2, RGB_DARKGREY, rc); // 091219

  SetPixel(hdc,o1.x,o1.y,RGB_YELLOW);
  SetPixel(hdc,o2.x,o2.y,RGB_YELLOW);


}
开发者ID:Acrobot,项目名称:LK8000,代码行数:33,代码来源:DrawCross.cpp

示例4: CalculateOrientationTargetPan

void MapWindow::CalculateOrigin(const RECT rc, POINT *Orig) {

  if (mode.Is(Mode::MODE_PAN)) {
	// North up
	DisplayAngle = 0.0;
	DisplayAircraftAngle = DrawInfo.TrackBearing;
	GliderCenter = true;
  } else {
	if (mode.Is(Mode::MODE_TARGET_PAN)) {
		CalculateOrientationTargetPan();
	} else {
		CalculateOrientationNormal();
	}
  }
  
  if(mode.Is(Mode::MODE_TARGET_PAN)) {
    if (ScreenLandscape) {
      Orig->x = (rc.left + rc.right - targetPanSize)/2;
      Orig->y = (rc.bottom + rc.top)/2;
    }
    else {
      Orig->x = (rc.left + rc.right)/2;
      Orig->y = (rc.bottom + rc.top + targetPanSize)/2;
    }
  }
  else if(mode.Is(Mode::MODE_PAN) || mode.Is(Mode::MODE_CIRCLING)) {
	Orig->x = (rc.left + rc.right)/2;
	Orig->y = (rc.bottom + rc.top)/2;
  } else {
	// automagic northup smart
	if (DisplayOrientation == NORTHSMART) { 
		double trackbearing = DrawInfo.TrackBearing;
		int middleXY,spanxy;
		if (ScreenLandscape) {
			middleXY=((rc.bottom-BottomSize)+rc.top)/2;
			spanxy=NIBLSCALE(50);
			Orig->y= middleXY + (int)(spanxy*fastcosine(trackbearing));
			// This was moving too much the map!
			// spanx=NIBLSCALE(40);
			// Orig->x= middleX - (int)(spanx*fastsine(trackbearing));
			Orig->x = (rc.left + rc.right)/2;
		} else {
			middleXY=(rc.left+rc.right)/2;
			spanxy=NIBLSCALE(50);
			Orig->x= middleXY - (int)(spanxy*fastsine(trackbearing));
			Orig->y = ((rc.bottom-BottomSize) + rc.top)/2;
		}
	} else {
		// 100924 if we are in north up autorient, position the glider in middle screen
		if ((zoom.Scale()*1.4) >= AutoOrientScale) {
			Orig->x = (rc.left + rc.right)/2;
			Orig->y=((rc.bottom-BottomSize)+rc.top)/2;
		} else {
			// else do it normally using configuration
			Orig->x = ((rc.right - rc.left )*GliderScreenPositionX/100)+rc.left;
			Orig->y = ((rc.top - rc.bottom )*GliderScreenPositionY/100)+rc.bottom;
		}
	}
  }
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:60,代码来源:OrigAndOrient.cpp

示例5: NIBLSCALE

void MapWindow::DrawTeammate(LKSurface& Surface, const RECT& rc, const ScreenProjection& _Proj) {
    if (TeammateCodeValid) {
        if (PointVisible(TeammateLongitude, TeammateLatitude)) {
            const POINT point = _Proj.LonLat2Screen(TeammateLongitude, TeammateLatitude);
            hBmpTeammatePosition.Draw(Surface, point.x - NIBLSCALE(10), point.y - NIBLSCALE(10), IBLSCALE(20), IBLSCALE(20));
        }
    }
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:8,代码来源:DrawTeamMate.cpp

示例6: NIBLSCALE

void MapWindow::DrawHeadUpLine(LKSurface& Surface, const POINT& Orig, const RECT& rc, double fMin, double fMax  ) {

    const double tmp = fMax*zoom.ResScaleOverDistanceModify();
    const double trackbearing =  DisplayAircraftAngle+  (DerivedDrawInfo.Heading-DrawInfo.TrackBearing);

    const POINT p2 = { Orig.x + (int)(tmp*fastsine(trackbearing)), Orig.y - (int)(tmp*fastcosine(trackbearing)) };

    const LKColor rgbCol = BlackScreen?RGB_INVDRAW:RGB_BLACK;

    // Reduce the rectangle for a better effect
    const RECT ClipRect = {rc.left+NIBLSCALE(5), rc.top+NIBLSCALE(5), rc.right-NIBLSCALE(5), rc.bottom-NIBLSCALE(5) };
    Surface.DrawLine(PEN_SOLID, NIBLSCALE(1), Orig, p2, rgbCol, ClipRect);
}
开发者ID:brunotl,项目名称:LK8000,代码行数:13,代码来源:TopView.cpp

示例7: assert

void MapWindow::DrawBitmapIn(LKSurface& Surface, const POINT &sc, const LKIcon& Icon, const bool autostretch) {
    if (!Icon) return; // don't draw Bitmap if no bitmap
    if (!PointVisible(sc)) return;

    assert(Icon.GetSize().cx == 10);
    assert(Icon.GetSize().cy == 10);
    
    if (autostretch) {
        Icon.Draw(Surface, sc.x - NIBLSCALE(5), sc.y - NIBLSCALE(5), IBLSCALE(10), IBLSCALE(10));
    } else {
        Icon.Draw(Surface, sc.x - NIBLSCALE(5), sc.y - NIBLSCALE(5), 10, 10);
    }
}
开发者ID:jaaaaf,项目名称:LK8000,代码行数:13,代码来源:Draw_Primitives.cpp

示例8: SelectObject

void MapWindow::DrawBitmapIn(const HDC hdc, const POINT &sc, const HBITMAP h, const bool autostretch) {
  if (!PointVisible(sc)) return;

  SelectObject(hDCTemp, h);

  DrawBitmapX(hdc,
              sc.x-NIBLSCALE(5),
              sc.y-NIBLSCALE(5),
              10,10,
	      hDCTemp,0,0,SRCPAINT, autostretch);
  DrawBitmapX(hdc,
              sc.x-NIBLSCALE(5),
              sc.y-NIBLSCALE(5),
              10,10,
              hDCTemp,10,0,SRCAND, autostretch);
}
开发者ID:Mazuk,项目名称:LK8000,代码行数:16,代码来源:Draw_Primitives.cpp

示例9: DrawTelescope

void DrawTelescope(HDC hdc, double fAngle, int x, int y)
{
	POINT Telescope[17] = {
			{  6 ,  7  },    // 1
			{  6 ,  2  },    // 2
			{  8 , -2  },    // 3
			{  8 , -7  },    // 4
			{  1 , -7  },    // 5
			{  1 , -2  },    // 6
			{ -1 , -2  },    // 7
			{ -1 , -7  },    // 8
			{ -8 , -7  },    // 9
			{ -8 , -2  },    // 10
			{ -6 ,  2  },    // 11
			{ -6 ,  7  },    // 12
			{ -1 ,  7  },    // 13
			{ -1 ,  3  },    // 14
			{  1 ,  3  },    // 15
			{  1 ,  7  },    // 16
			{  4 ,  7  }     // 17
	};



bool bBlack = true;
DrawWindRoseDirection( hdc, AngleLimit360( fAngle ),  x,  y + NIBLSCALE(18));
PolygonRotateShift(Telescope, 17, x, y, AngleLimit360( fAngle  ));

LKPen	oldBPen ;
LKBrush oldBrush ;
if (!bBlack)
{
  oldBPen  = Surface.SelectObject(LK_WHITE_PEN));
  oldBrush = Surface.SelectObject(LKBrush_White);
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:35,代码来源:Unused.cpp

示例10: VDrawLine

void VDrawLine(const HDC&hdc, const RECT rc, int x1, int y1, int x2, int y2, COLORREF col) {
  POINT p0,p1;
  p0.x = x1;
  p0.y = y1;
  p1.x = x2;
  p1.y = y2;
MapWindow::_DrawLine(hdc, PS_SOLID, NIBLSCALE(1), p0, p1, col, rc);
}
开发者ID:IvanSantanna,项目名称:LK8000,代码行数:8,代码来源:LKDrawInfoPage.cpp

示例11: DrawLKStatus

// LK Status message
void MapWindow::DrawLKStatus(HDC hdc, RECT rc) {

  TextInBoxMode_t TextDisplayMode = {0};
  TCHAR Buffer[LKSIZEBUFFERLARGE];

  short bottomlines;
  short middlex=(rc.right-rc.left)/2;
  short left=rc.left+NIBLSCALE(5);
  short contenttop=rc.top+NIBLSCALE(50);

  TextDisplayMode.Color = RGB_BLACK;
  TextDisplayMode.NoSetFont = 1;
  //TextDisplayMode.AlligneRight = 0;
  TextDisplayMode.AlligneCenter = 1;
  TextDisplayMode.WhiteBold = 1;
  TextDisplayMode.Border = 1;
  // HFONT oldfont=(HFONT)Surface.SelectObject(LK8PanelBigFont);

  switch(ModeIndex) {
	case LKMODE_MAP:
		_stprintf(Buffer,TEXT("MAP mode, 1 of 1"));
		break;
	case LKMODE_INFOMODE:
		_stprintf(Buffer,TEXT("%d-%d"), ModeIndex,CURTYPE+1);
		break;
	case LKMODE_WP:
		_stprintf(Buffer,TEXT("%d-%d"), ModeIndex,CURTYPE+1);
		break;
	case LKMODE_NAV:
		_stprintf(Buffer,TEXT("%d-%d"), ModeIndex,CURTYPE+1);
		break;
	default:
		_stprintf(Buffer,TEXT("UNKOWN mode"));
		break;
  }
  TextInBox(hdc, &rc, Buffer, middlex, 200 , 0, &TextDisplayMode, false);

  //Surface.SelectObject(oldfont);
  return;
}
开发者ID:LK8000,项目名称:LK8000,代码行数:41,代码来源:LKDrawCpuStatsDebug.cpp

示例12: _DrawLine

//
// The heading track line, like on Garmin units
//
void MapWindow::DrawHeading(HDC hdc, POINT Orig, RECT rc ) {

    if (DrawInfo.NAVWarning) return; // 100214

    if ( mode.Is(MapWindow::Mode::MODE_CIRCLING)) return;
    POINT p2;

    double tmp = 200000*zoom.ResScaleOverDistanceModify();
    if ( !( DisplayOrientation == TRACKUP || DisplayOrientation == NORTHCIRCLE || DisplayOrientation == TRACKCIRCLE )) {
        double trackbearing = DrawInfo.TrackBearing;
        p2.y= Orig.y - (int)(tmp*fastcosine(trackbearing));
        p2.x= Orig.x + (int)(tmp*fastsine(trackbearing));
    } else {
        p2.x=Orig.x;
        p2.y=Orig.y-(int)tmp;
    }

    // Reduce the rectangle for a better effect
    rc.top+=NIBLSCALE(5);
    rc.right-=NIBLSCALE(5);
    rc.bottom-=NIBLSCALE(5);
    rc.left+=NIBLSCALE(5);

    ForcedClipping=true;
    if (BlackScreen)
        _DrawLine(hdc, PS_SOLID, NIBLSCALE(1), Orig, p2, RGB_INVDRAW, rc); // 091109
    else
        _DrawLine(hdc, PS_SOLID, NIBLSCALE(1), Orig, p2, RGB_BLACK, rc);
    ForcedClipping=false;

}
开发者ID:peclik,项目名称:LK8000,代码行数:34,代码来源:DrawHeading.cpp

示例13: _DrawLine

//
// The heading track line, like on Garmin units
//
void MapWindow::DrawHeading(HDC hdc, POINT Orig, RECT rc ) {

   if (GPS_INFO.NAVWarning) return; // 100214

   if (zoom.RealScale()>5 || mode.Is(MapWindow::Mode::MODE_CIRCLING)) return;
   POINT p2;

   double tmp = 12000*zoom.ResScaleOverDistanceModify();
   if ( !( DisplayOrientation == TRACKUP || DisplayOrientation == NORTHCIRCLE || DisplayOrientation == TRACKCIRCLE )) {
	double trackbearing = DrawInfo.TrackBearing;
	p2.y= Orig.y - (int)(tmp*fastcosine(trackbearing));
	p2.x= Orig.x + (int)(tmp*fastsine(trackbearing));
   } else {
	p2.x=Orig.x;
	p2.y=Orig.y-(int)tmp;
   }

   if (BlackScreen)
	   _DrawLine(hdc, PS_SOLID, NIBLSCALE(1), Orig, p2, RGB_INVDRAW, rc); // 091109
   else
	   _DrawLine(hdc, PS_SOLID, NIBLSCALE(1), Orig, p2, RGB_BLACK, rc);

}
开发者ID:Mazuk,项目名称:LK8000,代码行数:26,代码来源:DrawHeading.cpp

示例14: NIBLSCALE

//
// Turn Rate Indicator
//
void MapWindow::DrawAcceleration(HDC hDC, const RECT rc)
{
  const double ScaleX = (rc.right - rc.left)/10;
  const double ScaleY = (rc.top - rc.bottom)/10;
  const double ScaleZ = (rc.top - rc.bottom)/20;
  POINT Pos;
  Pos.x = (rc.right - rc.left)/2 + (int)(DrawInfo.AccelY * ScaleX);
  Pos.y = (rc.bottom - rc.top)/2 - (int)((DrawInfo.AccelZ - 1) * ScaleY);
  const double radius = NIBLSCALE(15) + (int)(DrawInfo.AccelX * ScaleZ);
  
  const HPEN    oldPen   = (HPEN) SelectObject(hDC, GetStockObject(BLACK_PEN));
  const HBRUSH  oldBrush = (HBRUSH)SelectObject(hDC, LKBrush_Red);
  Circle(hDC, Pos.x, Pos.y - (int)(radius/2), (int)radius, rc, true, true);
  
  SelectObject(hDC, oldBrush);
  SelectObject(hDC, oldPen);
}
开发者ID:Turbo87,项目名称:LK8000,代码行数:20,代码来源:DrawTRI.cpp

示例15: switch

void MapWindow::DrawStartEndSector(LKSurface& Surface, const RECT& rc,
        const POINT &Start, const POINT &End, int Index,
        int Type, double Radius) {

    double tmp;
    LKSurface::OldPen oldpen;
    LKSurface::OldBrush oldbrush;

    switch (Type) {
        case 0: // CIRCLE
            tmp = Radius * zoom.ResScaleOverDistanceModify();
            oldpen = Surface.SelectObject(hpStartFinishThick);
            oldbrush = Surface.SelectObject(LKBrush_Hollow);
            Surface.Circle(WayPointList[Index].Screen.x,
                    WayPointList[Index].Screen.y, (int) tmp, rc, false, false);
            Surface.SelectObject(LKPen_Red_N1);
            Surface.Circle(WayPointList[Index].Screen.x,
                    WayPointList[Index].Screen.y, (int) tmp, rc, false, false);

            Surface.SelectObject(oldpen);
            Surface.SelectObject(oldbrush);
            break;
        case 1: // LINE
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(5), End, Start, taskcolor, rc);
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(1), End, Start, LKColor(255, 0, 0), rc);
            break;
        case 2: // SECTOR
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(5), WayPointList[Index].Screen,
                    Start, taskcolor, rc);
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(5), WayPointList[Index].Screen,
                    End, taskcolor, rc);
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(1), WayPointList[Index].Screen,
                    Start, LKColor(255, 0, 0), rc);
            Surface.DrawLine(PEN_SOLID, NIBLSCALE(1), WayPointList[Index].Screen,
                    End, LKColor(255, 0, 0), rc);
            break;
    }

}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:39,代码来源:DrawStartSector.cpp


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