本文整理汇总了C++中LKSurface::DrawCircle方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::DrawCircle方法的具体用法?C++ LKSurface::DrawCircle怎么用?C++ LKSurface::DrawCircle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::DrawCircle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
}
}
示例2: 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);
}
示例3: RenderTask
//.........这里部分代码省略.........
}
ScaleMakeSquare(rc);
// draw aat areas
if (AATEnabled)
{
for (i=MAXTASKPOINTS-1; i>0; i--)
{
if (ValidTaskPoint(i))
{
lat1 = WayPointList[Task[i-1].Index].Latitude;
lon1 = WayPointList[Task[i-1].Index].Longitude;
lat2 = WayPointList[Task[i].Index].Latitude;
lon2 = WayPointList[Task[i].Index].Longitude;
x1 = (lon1-lon_c)*fastcosine(lat1);
y1 = (lat1-lat_c);
x2 = (lon2-lon_c)*fastcosine(lat2);
y2 = (lat2-lat_c);
#ifdef HAVE_HATCHED_BRUSH
Surface.SelectObject(MapWindow::GetAirspaceBrushByClass(AATASK));
#else
Surface.SelectObject(LKBrush_Yellow);
#endif
Surface.SelectObject(LK_WHITE_PEN);
if (Task[i].AATType == SECTOR)
{
Surface.Segment((long)((x2-x_min)*xscale+rc.left+BORDER_X),(long)((y_max-y2)*yscale+rc.top),(long)(aatradius[i]*yscale),rc, Task[i].AATStartRadial, Task[i].AATFinishRadial);
}
else
{
Surface.DrawCircle((long)((x2-x_min)*xscale+rc.left+BORDER_X), (long)((y_max-y2)*yscale+rc.top), (long)(aatradius[i]*yscale), true);
}
}
}
}
if (!AATEnabled)
{
for (i=MAXTASKPOINTS-1; i>0; i--)
{
if (ValidTaskPoint(i) && ValidTaskPoint(i-1))
{
lat1 = WayPointList[Task[i-1].Index].Latitude;
lon1 = WayPointList[Task[i-1].Index].Longitude;
if (!ValidTaskPoint(1) ) {
lat2 = GPS_INFO.Latitude;
lon2 = GPS_INFO.Longitude;
}
else
{
lat2 = WayPointList[Task[i].Index].Latitude;
lon2 = WayPointList[Task[i].Index].Longitude;
}
x1 = (lon1-lon_c)*fastcosine(lat1);
y1 = (lat1-lat_c);
x2 = (lon2-lon_c)*fastcosine(lat2);
y2 = (lat2-lat_c);
// DrawLine(hdc, rc, x1, y1, x2, y2, STYLE_DASHGREEN);
if( ValidTaskPoint(4) && i <2)
goto skip_FAI;
#ifndef UNDITHER
RenderFAISector ( Surface, rc, lat1, lon1, lat2, lon2, lat_c, lon_c,1, RGB_LIGHTYELLOW );
示例4: LKDrawFLARMTraffic
//.........这里部分代码省略.........
sc_name = sc;
sc_name.y -= NIBLSCALE(16);
sc_av = sc_name;
_tcscpy(lbuffer,_T(""));
if (DrawInfo.FLARM_Traffic[i].Cn && DrawInfo.FLARM_Traffic[i].Cn[0]!=_T('?')) { // 100322
_tcscat(lbuffer,DrawInfo.FLARM_Traffic[i].Cn);
}
if (DrawInfo.FLARM_Traffic[i].Average30s>=0.1) {
size_t len = _tcslen(lbuffer);
if (len > 0)
_stprintf(lbuffer + len,_T(":%.1f"),LIFTMODIFY*DrawInfo.FLARM_Traffic[i].Average30s);
else
_stprintf(lbuffer,_T("%.1f"),LIFTMODIFY*DrawInfo.FLARM_Traffic[i].Average30s);
}
displaymode.Border=1;
if (_tcslen(lbuffer)>0)
TextInBox(Surface, &rc, lbuffer, sc.x+tscaler, sc.y+tscaler, &displaymode, false);
// red circle
if ((DrawInfo.FLARM_Traffic[i].AlarmLevel>0) && (DrawInfo.FLARM_Traffic[i].AlarmLevel<4)) {
DrawBitmapIn(Surface, sc, hFLARMTraffic,true);
}
#if 1 // 1
Arrow[0].x = -4;
Arrow[0].y = 5;
Arrow[1].x = 0;
Arrow[1].y = -6;
Arrow[2].x = 4;
Arrow[2].y = 5;
Arrow[3].x = 0;
Arrow[3].y = 2;
Arrow[4].x = -4;
Arrow[4].y = 5;
for (int q=0; q < 5; q++)
{
Arrow[q].x = (LONG) ((double)Arrow[q].x * 1.7);
Arrow[q].y = (LONG) ((double)Arrow[q].y * 1.7);
}
#else
Arrow[0].x = scaler[0];
Arrow[0].y = scaler[1];
Arrow[1].x = 0;
Arrow[1].y = scaler[2];
Arrow[2].x = scaler[3];
Arrow[2].y = scaler[1];
Arrow[3].x = 0;
Arrow[3].y = scaler[4];
Arrow[4].x = scaler[0];
Arrow[4].y = scaler[1];
#endif
/*
switch (DrawInfo.FLARM_Traffic[i].Status) { // 100321
case LKT_GHOST:
Surface.SelectObject(yellowBrush);
break;
case LKT_ZOMBIE:
Surface.SelectObject(redBrush);
break;
default:
Surface.SelectObject(greenBrush);
break;
}
*/
/*************************************************************************
* calculate climb color
*************************************************************************/
int iVarioIdx = (int)(2*DrawInfo.FLARM_Traffic[i].Average30s -0.5)+NO_VARIO_COLORS/2;
if(iVarioIdx < 0) iVarioIdx =0;
if(iVarioIdx >= NO_VARIO_COLORS) iVarioIdx =NO_VARIO_COLORS-1;
Surface.SelectObject(*variobrush[iVarioIdx]);
switch (DrawInfo.FLARM_Traffic[i].Status) { // 100321
case LKT_GHOST:
Surface.Rectangle(sc.x-iRectangleSize, sc.y-iRectangleSize,sc.x+iRectangleSize, sc.y+iRectangleSize);
break;
case LKT_ZOMBIE:
Surface.DrawCircle(sc.x, sc.x, iCircleSize, rc, true );
break;
default:
PolygonRotateShift(Arrow, 5, sc.x, sc.y, DrawInfo.FLARM_Traffic[i].TrackBearing - DisplayAngle);
Surface.Polygon(Arrow,5);
break;
}
}
}
Surface.SelectObject(oldfont);
Surface.SelectObject(hpold);
}
示例5: DrawRunway
//.........这里部分代码省略.........
#if defined(ANDROID) || defined(KOBO)
l = (int)(l * 2.0 * fScaleFact / ScreenScale); if(l==0) l=1;
b = (int)(b * 2.0 * fScaleFact / ScreenScale); if(b==0) b=1;
p = (int)(cir * 2.0 * fScaleFact); if(p==0) p=1;
#else
l = (int)(l * fScaleFact); if(l==0) l=1;
b = (int)(b * fScaleFact); if(b==0) b=1;
p = (int)(cir * 2.0 * fScaleFact); if(p==0) p=1;
#endif
switch(wp->Style) {
case STYLE_AIRFIELDSOLID: solid = true; bRunway = true; bOutland = false; bGlider = false; break;
case STYLE_AIRFIELDGRASS: solid = false; bRunway = true; bOutland = false; bGlider = false; break;
case STYLE_OUTLANDING : solid = false; bRunway = true; bOutland = true; bGlider = false; b*=2; break;
case STYLE_GLIDERSITE : solid = false; bRunway = true; bOutland = false; bGlider = true; break;
default: return; break;
}
// Do not print glidersite at low zoom levels, in any case
// not useful on some resolutions
// if( !picto && (MapWindow::zoom.RealScale() > 3) )
// bGlider=false;
const auto oldPen = Surface.SelectObject(LK_BLACK_PEN);
const auto oldBrush = Surface.SelectObject(LKBrush_Red);
if( wp->Reachable == TRUE)
Surface.SelectObject(LKBrush_Green);
if(!bOutland)
{
if (picto)
Surface.DrawCircle(Center.x, Center.y, p, true);
else
Surface.DrawCircle(Center.x, Center.y, p, rc, true);
}
if(bRunway)
{
POINT Runway[5] = {
{ b, l }, // 1
{-b, l }, // 2
{-b,-l }, // 3
{ b,-l }, // 4
{ b,l } // 5
};
if(!bOutland)
{
#ifndef DITHER
if(solid)
Surface.SelectObject(LKBrush_DarkGrey );
else
Surface.SelectObject(LKBrush_White);
#else
if(solid)
Surface.SelectObject(LKBrush_Black);
else
Surface.SelectObject(LKBrush_White);
#endif
}
if(picto) {
threadsafePolygonRotateShift(Runway, 5, Center.x, Center.y, wp->RunwayDir);
} else {
PolygonRotateShift(Runway, 5, Center.x, Center.y, wp->RunwayDir- (int)MapWindow::GetDisplayAngle());
}