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


C++ LKSurface::SelectObject方法代码示例

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


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

示例1: DrawThermalEstimateMultitarget

//
// Paint a circle around thermal multitarget
// Called only during map mode L>
//
void MapWindow::DrawThermalEstimateMultitarget(LKSurface& Surface, const RECT& rc, const ScreenProjection& _Proj) {

  int idx=0;

  // do not mix old and new thermals
  if (mode.Is(Mode::MODE_CIRCLING))
    return;

  // draw only when visible , at high zoom level
  if ( MapWindow::zoom.RealScale() >1 ) return;

  idx=GetThermalMultitarget();
  // no L> target destination
  if (idx <0)
    return;

  const POINT screen = _Proj.LonLat2Screen( ThermalHistory[idx].Longitude, ThermalHistory[idx].Latitude);

  double tradius;
  if (ISPARAGLIDER)
     tradius=100;
  else
     tradius=200;

  const auto oldPen = Surface.SelectObject(LKPen_White_N3);

  Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify()), rc, false);
  Surface.SelectObject(LKPen_White_N2);
  Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify())+NIBLSCALE(2), rc, false);
  Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify()), rc, false);

  Surface.SelectObject(oldPen);
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例2: DrawBarChart

void Statistics::DrawBarChart(LKSurface& Surface, const RECT& rc, LeastSquares* lsdata) {
  int i;
LKColor Col;
  if (unscaled_x || unscaled_y) {
    return;
  }

if(INVERTCOLORS)
  Col = RGB_GREEN.ChangeBrightness(0.5);
else
  Col = RGB_WHITE;

  LKPen hpBar(PEN_SOLID, IBLSCALE(1), Col);
  LKBrush hbBar(Col);
  const auto oldpen = Surface.SelectObject(hpBar);
  const auto oldbrush = Surface.SelectObject(hbBar);


  int xmin, ymin, xmax, ymax;

  for (i= 0; i<lsdata->sum_n; i++) {
    xmin = (int)((i+1+0.2)*xscale)+rc.left+BORDER_X;
    ymin = (int)((y_max-y_min)*yscale)+rc.top;
    xmax = (int)((i+1+0.8)*xscale)+rc.left+BORDER_X;
    ymax = (int)((y_max-lsdata->ystore[i])*yscale)+rc.top;
    Surface.Rectangle(xmin, ymin, xmax, ymax);
  }

  Surface.SelectObject(oldpen);
  Surface.SelectObject(oldbrush);
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:31,代码来源:DrawOtherFunctions.cpp

示例3: OnPaintAirspacePicto

static void OnPaintAirspacePicto(WindowControl * Sender, LKSurface& Surface){
	  (void)Sender;

	  WndFrame  *wPicto = ((WndFrame *)wf->FindByName(TEXT("frmAirspacePicto")));
	  LKASSERT(wPicto!=NULL);
	  const RECT rc = wPicto->GetClientRect();
	  Surface.SelectObject(LKPen_Petrol_C2);

	  Surface.SelectObject(LKBrush_Petrol);
	  Surface.Rectangle(rc.left,rc.top,rc.right,rc.bottom);


	  Surface.SetBkColor(RGB_LIGHTGREY);
      /****************************************************************
       * for drawing the airspace pictorial, we need the original data.
       * copy contain only base class property, not geo data, 
       * original data are shared ressources ! 
       * for that we need to grant all called methods are thread safe
       ****************************************************************/
   {
      CCriticalSection::CGuard guard(CAirspaceManager::Instance().MutexRef());
      CAirspace* airspace = CAirspaceManager::Instance().GetAirspacesForDetails();
      if(airspace) {
        airspace->DrawPicto(Surface, rc);
      }
   }
}
开发者ID:SergioDaSilva82,项目名称:LK8000,代码行数:27,代码来源:dlgAirspaceDetails.cpp

示例4: DrawThermalEstimate

//
// Draw circles and gadgets for thermals
//
void MapWindow::DrawThermalEstimate(LKSurface& Surface, const RECT& rc, const ScreenProjection& _Proj) {
  if (!EnableThermalLocator) return;

  if (mode.Is(Mode::MODE_CIRCLING)) {
	if (DerivedDrawInfo.ThermalEstimate_R>0) {
		const POINT screen = _Proj.LonLat2Screen(DerivedDrawInfo.ThermalEstimate_Longitude, DerivedDrawInfo.ThermalEstimate_Latitude);
		DrawBitmapIn(Surface, screen, hBmpThermalSource);

		const auto oldBrush = Surface.SelectObject(LKBrush_Hollow);
		double tradius;
		if (ISPARAGLIDER)
			tradius=50;
		else
			tradius=100;

		const auto oldPen = Surface.SelectObject(LKPen_White_N3);
		Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify()), rc, true);
		Surface.SelectObject(LKPen_Black_N1);
		Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify())+NIBLSCALE(2), rc, true);
		Surface.DrawCircle(screen.x, screen.y, (int)(tradius*zoom.ResScaleOverDistanceModify()), rc, true);

		Surface.SelectObject(oldPen);
        Surface.SelectObject(oldBrush);
	}
  } else {
	if (zoom.RealScale() <= 4) {
		for (int i=0; i<MAX_THERMAL_SOURCES; i++) {
			if (DerivedDrawInfo.ThermalSources[i].Visible) {
				DrawBitmapIn(Surface, DerivedDrawInfo.ThermalSources[i].Screen, hBmpThermalSource);
			}
		}
	}
  }
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例5: OnAirspacePaintListItem

static void OnAirspacePaintListItem(WindowControl * Sender, LKSurface& Surface){

  TCHAR label[40];
  (void)Sender;
  if (DrawListIndex < AIRSPACECLASSCOUNT){
    int i = DrawListIndex;
	LK_tcsncpy(label, CAirspaceManager::Instance().GetAirspaceTypeText(i), 39);
    int w0, w1, w2, x0;
    if (ScreenLandscape) {
      w0 = 202*ScreenScale;
    } else {
      w0 = 225*ScreenScale;
    }
	// LKTOKEN  [email protected]_ = "Warn"
    w1 = Surface.GetTextWidth(MsgToken(789))+ScreenScale*10;
	// LKTOKEN  [email protected]_ = "Display"
    w2 = Surface.GetTextWidth(MsgToken(241))+ScreenScale*10;
    x0 = w0-w1-w2;

    Surface.SetTextColor(RGB_BLACK);
    Surface.DrawTextClip(2*ScreenScale, 2*ScreenScale,
                   label, x0-ScreenScale*10);

    if (colormode) {

      Surface.SelectObject(LK_WHITE_PEN);
      Surface.SelectObject(LKBrush_White);
      Surface.Rectangle(x0, 2*ScreenScale,w0, 22*ScreenScale);
      Surface.SetTextColor(MapWindow::GetAirspaceColourByClass(i));
      Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
      Surface.SelectObject(MapWindow::GetAirspaceBrushByClass(i));
      Surface.Rectangle(x0, 2*ScreenScale,w0, 22*ScreenScale);

    } else {

      bool iswarn;
      bool isdisplay;

      iswarn = (MapWindow::iAirspaceMode[i]>=2);
      isdisplay = ((MapWindow::iAirspaceMode[i]%2)>0);
      if (iswarn) {
	// LKTOKEN  [email protected]_ = "Warn"
        _tcscpy(label, MsgToken(789));
        Surface.DrawText(w0-w1-w2, 2*ScreenScale, label);
      }
      if (isdisplay) {
	// LKTOKEN  [email protected]_ = "Display"
        _tcscpy(label, MsgToken(241));
        Surface.DrawText(w0-w2, 2*ScreenScale, label);
      }

    }

  }
}
开发者ID:,项目名称:,代码行数:55,代码来源:

示例6: DrawXLabel

void Statistics::DrawXLabel(LKSurface& Surface, const RECT& rc, const TCHAR *text) {
  SIZE tsize;
  const auto hfOld = Surface.SelectObject(LK8GenericVar03Font);
  Surface.GetTextSize(text, _tcslen(text), &tsize);
  int x = rc.right-tsize.cx-IBLSCALE(3);
  int y = rc.bottom-tsize.cy;
  if(INVERTCOLORS)
    Surface.SelectObject(LK_BLACK_PEN);

  Surface.DrawText(x, y, text, _tcslen(text));
  Surface.SelectObject(hfOld);
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:12,代码来源:DrawOtherFunctions.cpp

示例7: OnAirspacePatternsPaintListItem

static void OnAirspacePatternsPaintListItem(WindowControl * Sender, LKSurface& Surface) {
    (void) Sender;
    if ((DrawListIndex < NUMAIRSPACEBRUSHES) &&(DrawListIndex >= 0)) {
        int i = DrawListIndex;
        Surface.SelectObject(LKBrush_White);
        Surface.SelectObject(LK_BLACK_PEN);
        Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
        Surface.SelectObject(MapWindow::GetAirspaceBrush(i));
        Surface.SetTextColor(LKColor(0x00, 0x00, 0x00));
        Surface.Rectangle(100 * ScreenScale, 2 * ScreenScale, 180 * ScreenScale, 22 * ScreenScale);
    }
}
开发者ID:alberiolima,项目名称:LK8000,代码行数:12,代码来源:dlgAirspacePatterns.cpp

示例8: DrawYLabel

void Statistics::DrawYLabel(LKSurface& Surface, const RECT& rc, const TCHAR *text) {
  SIZE tsize;
  const auto hfOld = Surface.SelectObject(LK8GenericVar03Font);
  Surface.GetTextSize(text, _tcslen(text), &tsize);
  int x = max(2,(int)rc.left-(int)tsize.cx);
  int y = rc.top;
  if(INVERTCOLORS)
    Surface.SelectObject(LK_BLACK_PEN);


  Surface.DrawText(x, y, text, _tcslen(text));
  Surface.SelectObject(hfOld);
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:13,代码来源:DrawOtherFunctions.cpp

示例9: OnAirspaceColoursPaintListItem

static void OnAirspaceColoursPaintListItem(WindowControl * Sender, LKSurface& Surface){
  (void)Sender;
  if ((DrawListIndex < NUMAIRSPACECOLORS) &&(DrawListIndex>=0)) {
    int i = DrawListIndex;
    Surface.SelectObject(LKBrush_White);
    Surface.SelectObject(LK_BLACK_PEN);
    Surface.SetBkColor(LKColor(0xFF, 0xFF, 0xFF));
    Surface.SelectObject(MapWindow::GetAirspaceSldBrush(i)); // this is the solid brush
    Surface.SetTextColor(MapWindow::GetAirspaceColour(i));
    Surface.Rectangle(
              100*ScreenScale, 
              2*ScreenScale,
              180*ScreenScale,
              22*ScreenScale);
  }
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:16,代码来源:dlgAirspaceColours.cpp

示例10: DrawGreatCircle

//
// Draw bearing line to target
//
void MapWindow::DrawGreatCircle(LKSurface& Surface, double startLon, double startLat, double targetLon, double targetLat,
				const RECT& rc) {

  POINT pt[2];

  LatLon2Screen(startLon, startLat, pt[0]);
  LatLon2Screen(targetLon, targetLat, pt[1]);

    if(LKGeom::ClipLine(rc, pt[0], pt[1])) {
        const auto hpOld = Surface.SelectObject(LKPen_GABRG);
        Surface.Polyline(pt, 2);
        Surface.SelectObject(LK_BLACK_PEN);
        Surface.Polyline(pt, 2);
        Surface.SelectObject(hpOld);
    }
}
开发者ID:acasadoalonso,项目名称:LK8000,代码行数:19,代码来源:DrawGreatCircle.cpp

示例11: DrawGreatCircle

//
// Draw bearing line to target
//
void MapWindow::DrawGreatCircle(LKSurface& Surface, const RECT& rc, const ScreenProjection& _Proj, 
        double startLon, double startLat, double targetLon, double targetLat) {

    POINT pt[2] = {
        _Proj.LonLat2Screen(startLon, startLat),
        _Proj.LonLat2Screen(targetLon, targetLat)
    };


    if(LKGeom::ClipLine(rc, pt[0], pt[1])) {
        const auto hpOld = Surface.SelectObject(LKPen_GABRG);
        Surface.Polyline(pt, 2);
        Surface.SelectObject(LK_BLACK_PEN);
        Surface.Polyline(pt, 2);
        Surface.SelectObject(hpOld);
    }
}
开发者ID:PhilColbert,项目名称:LK8000,代码行数:20,代码来源:DrawGreatCircle.cpp

示例12: DrawBestCruiseTrack

void MapWindow::DrawBestCruiseTrack(LKSurface& Surface, const POINT& Orig)
{
  if (OvertargetMode>OVT_TASK) return;

  if (!ValidTaskPoint(ActiveTaskPoint)) return;

  if (DerivedDrawInfo.WaypointDistance < 0.010) return;

  // dont draw bestcruise indicator if not needed
  if (fabs(DerivedDrawInfo.BestCruiseTrack-DerivedDrawInfo.WaypointBearing)<2) { // 091202 10 to 2
	return;
  } 


  const auto hpOld = Surface.SelectObject(LKPen_Blue_N1);
  const auto hbOld = Surface.SelectObject(LKBrush_Blue);

  if (Appearance.BestCruiseTrack == ctBestCruiseTrackDefault){

    int dy = (long)(70); 
    POINT Arrow[7] = { {-1,-40}, {1,-40}, {1,0}, {6,8}, {-6,8}, {-1,0}, {-1,-40}};

    Arrow[2].y -= dy;
    Arrow[3].y -= dy;
    Arrow[4].y -= dy;
    Arrow[5].y -= dy;

    PolygonRotateShift(Arrow, 7, Orig.x, Orig.y, 
                       DerivedDrawInfo.BestCruiseTrack-DisplayAngle);

    Surface.Polygon(Arrow,7);

  } else
  if (Appearance.BestCruiseTrack == ctBestCruiseTrackAltA){

    POINT Arrow[] = { {-1,-40}, {-1,-62}, {-6,-62}, {0,-70}, {6,-62}, {1,-62}, {1,-40}, {-1,-40}};

    PolygonRotateShift(Arrow, sizeof(Arrow)/sizeof(Arrow[0]),
                       Orig.x, Orig.y, 
                       DerivedDrawInfo.BestCruiseTrack-DisplayAngle);
    Surface.Polygon(Arrow, (sizeof(Arrow)/sizeof(Arrow[0])));
  }

  Surface.SelectObject(hpOld);
  Surface.SelectObject(hbOld);
}
开发者ID:LK8000,项目名称:LK8000,代码行数:46,代码来源:DrawBestCruiseTrack.cpp

示例13: DrawAirSpaceBorders

void MapWindow::DrawAirSpaceBorders(LKSurface& Surface, const RECT& rc)
{
  CAirspaceList::const_iterator it;
  const CAirspaceList& airspaces_to_draw = CAirspaceManager::Instance().GetNearAirspacesRef();
  int airspace_type;
  static bool asp_selected_flash = false;
  asp_selected_flash = !asp_selected_flash;
  LKBrush oldBrush = Surface.SelectObject(LKBrush_Hollow);
  
  CCriticalSection::CGuard guard(CAirspaceManager::Instance().MutexRef());
  //    for (it=airspaces_to_draw.end(); it != airspaces_to_draw.begin(); it--)

      /***********************************************************************
       * draw underlying aispaces first (reverse order) with bigger pen
       * *********************************************************************/
      it=airspaces_to_draw.end();
      if (it!=airspaces_to_draw.begin())
      do
      {
	it--;
        if ((*it)->DrawStyle()) {
          airspace_type = (*it)->Type();
          if ( asp_selected_flash && (*it)->Selected() ) {
            Surface.SelectObject(LK_BLACK_PEN);
          } else {
            Surface.SelectObject(hBigAirspacePens[airspace_type]);
          }
          if((*it)->DrawStyle()==adsDisabled)
            Surface.SelectObject(LKPen_Grey_N2 );

          (*it)->Draw(Surface, rc, false);
        }
      } while (it !=airspaces_to_draw.begin());

      /***********************************************************************
       * now draw aispaces on top (normal order) with thin pen
       ***********************************************************************/

      for (it=airspaces_to_draw.begin(); it != airspaces_to_draw.end(); ++it) {
        if ((*it)->DrawStyle()) {
          airspace_type = (*it)->Type();
          if ( asp_selected_flash && (*it)->Selected() ) {
            Surface.SelectObject(LK_BLACK_PEN);
          } else {
            Surface.SelectObject(hAirspacePens[airspace_type]);
          }
          if((*it)->DrawStyle()==adsDisabled)
            Surface.SelectObject(LKPen_Black_N0 );
          (*it)->Draw(Surface, rc, false);
        }
      }//for


  Surface.SelectObject(oldBrush);
}
开发者ID:alberiolima,项目名称:LK8000,代码行数:55,代码来源:DrawAirSpacesBorders.cpp

示例14: LKDrawLongTrail

void MapWindow::LKDrawLongTrail( LKSurface& Surface, const RECT& rc, const ScreenProjection& _Proj) {
    static RasterPoint snail_polyline[array_size(LongSnailTrail)+1]; // +1 for last point of "normal" snail trail

    if (TrailActive != 3) return; // only when full trail is selected
    if (iLongSnailNext < 2) return; // no reason to draw a single point

    if (MapWindow::mode.Is(MapWindow::Mode::MODE_CIRCLING)) {
        return;
    }

    // pixel manhattan distance
    // It is the sum of x and y differences between previous and next point on screen, in pixels.
    // below this distance, no painting
    const unsigned nearby=10;

    const LONG_SNAIL_POINT* end_iterator = std::begin(LongSnailTrail);
    const LONG_SNAIL_POINT* cur_iterator = std::prev(std::next(LongSnailTrail,iLongSnailNext));
    RasterPoint* polyline_iterator = std::begin(snail_polyline);

    const SNAIL_POINT* last_point = std::next(std::next(SnailTrail, iSnailNext));
    if(last_point == std::end(SnailTrail)) {
        last_point = std::begin(SnailTrail);
    }
    (*polyline_iterator) = _Proj.LonLat2Screen(last_point->Longitude, last_point->Latitude);

    polyline_iterator = std::next(polyline_iterator);

    const auto oldPen = Surface.SelectObject(hSnailPens[3]); // blue color

    while(cur_iterator != end_iterator) {

        (*polyline_iterator) = _Proj.LonLat2Screen(cur_iterator->Longitude, cur_iterator->Latitude);

        if(manhattan_distance(*std::prev(polyline_iterator),(*polyline_iterator)) > nearby) {
            polyline_iterator = std::next(polyline_iterator);
        }
        cur_iterator = std::prev(cur_iterator);
    }
    Surface.Polyline(snail_polyline, std::distance(snail_polyline, polyline_iterator) , rc);

    Surface.SelectObject(oldPen);
}
开发者ID:brunotl,项目名称:LK8000,代码行数:42,代码来源:LKDrawLongTrail.cpp

示例15: DrawStartEndSector

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


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