本文整理汇总了C++中LKSurface::DrawSolidLine方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::DrawSolidLine方法的具体用法?C++ LKSurface::DrawSolidLine怎么用?C++ LKSurface::DrawSolidLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::DrawSolidLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawVisualGlide
//.........这里部分代码省略.........
else
vscale = 300.0;
#endif
Surface.SetBackgroundTransparent();
RECT trc = rci;
// Top part of visual rect, target is over us=unreachable=red
trc.top = rci.top;
trc.bottom = center.y - 1;
#ifndef DITHER
RenderSky(Surface, trc, RGB_WHITE, LKColor(150, 255, 150), GC_NO_COLOR_STEPS / 2);
#else
RenderSky(Surface, trc, RGB_WHITE, RGB_WHITE, GC_NO_COLOR_STEPS / 2);
#endif
// Bottom part, target is below us=reachable=green
trc.top = center.y + 1;
trc.bottom = rci.bottom;
#ifndef DITHER
RenderSky(Surface, trc, LKColor(255, 150, 150), RGB_WHITE, GC_NO_COLOR_STEPS / 2);
#else
RenderSky(Surface, trc, RGB_WHITE, RGB_WHITE,GC_NO_COLOR_STEPS / 2);
#endif
// Draw center line
p1.x = rci.left + 1;
p1.y = center.y;
p2.x = rci.right - 1;
p2.y = center.y;
Surface.SelectObject(LKPen_Black_N1);
Surface.DrawSolidLine(p1, p2, rci);
#if DEBUG_SCR
StartupStore(_T("... Center line: Y=%d\n"), center.y);
#endif
Surface.SelectObject(line1Font);
Surface.SelectObject(LKPen_Black_N0);
ResetVisualGlideGlobals();
short res = GetVisualGlidePoints(numSlotX);
if (res == INVALID_VALUE) {
#if DEBUG_DVG
StartupStore(_T("...... GVGP says not ready, wait..\n"));
#endif
return;
}
if (res == 0) {
#if DEBUG_DVG
StartupStore(_T("...... GVGP says no data available!\n"));
#endif
return;
}
// Print them all!
int offset = (boxSizeY / 2) + CENTERYSPACE;
LKBrush bcolor;
LKColor rgbcolor, textcolor;
int wp;
示例2: DrawMapScale
void MapWindow::DrawMapScale(LKSurface& Surface, const RECT& rc /* the Map Rect*/,
const bool ScaleChangeFeedback)
{
static short terrainwarning=0;
static POINT lineOneStart, lineOneEnd,lineTwoStart,lineTwoEnd,lineThreeStart,lineThreeEnd;
static POINT lineTwoStartB,lineThreeStartB;
static int ytext;
static bool flipflop=true;
if (DoInit[MDI_DRAWMAPSCALE]) {
lineOneStart.x = MAPSCALE_RIGHTMARGIN;
lineOneEnd.x = MAPSCALE_RIGHTMARGIN;
lineOneStart.y = MAPSCALE_BOTTOMMARGIN;
lineOneEnd.y = lineOneStart.y - MAPSCALE_VSIZE;
lineTwoStart.x = MAPSCALE_RIGHTMARGIN - MAPSCALE_HSIZE;
lineTwoEnd.x = MAPSCALE_RIGHTMARGIN;
lineTwoEnd.y = lineOneStart.y;
lineTwoStart.y = lineOneStart.y;
lineThreeStart.y = lineTwoStart.y - MAPSCALE_VSIZE;
lineThreeEnd.y = lineThreeStart.y;
lineThreeStart.x = lineTwoStart.x;
lineThreeEnd.x = lineTwoEnd.x;
lineTwoStartB=lineTwoStart;
lineTwoStartB.x++;
lineThreeStartB=lineThreeStart;
lineThreeStartB.x++;
SIZE tsize;
Surface.SelectObject(MapScaleFont);
Surface.GetTextSize(_T("M"),1,&tsize);
int ofs=(MAPSCALE_VSIZE - (tsize.cy + tsize.cy))/2;
ytext=lineThreeStart.y+ofs;
DoInit[MDI_DRAWMAPSCALE]=false;
}
TCHAR Scale[200];
TCHAR Scale1[200];
TCHAR Scale2[200];
TCHAR TEMP[20];
const auto hpOld = Surface.SelectObject(hpMapScale2);
Surface.DrawSolidLine(lineOneStart,lineOneEnd, rc);
Surface.DrawSolidLine(lineTwoStart,lineTwoEnd, rc);
Surface.DrawSolidLine(lineThreeStart,lineThreeEnd, rc);
Surface.SelectObject(LKPen_White_N0);
Surface.DrawSolidLine(lineOneStart,lineOneEnd, rc);
Surface.DrawSolidLine(lineTwoStartB,lineTwoEnd, rc);
Surface.DrawSolidLine(lineThreeStartB,lineThreeEnd, rc);
Surface.SelectObject(hpOld);
flipflop=!flipflop;
_tcscpy(Scale2,TEXT(""));
bool inpanmode= (!mode.Is(Mode::MODE_TARGET_PAN) && mode.Is(Mode::MODE_PAN));
if (inpanmode) {
if (DerivedDrawInfo.TerrainValid) {
double alt= ALTITUDEMODIFY*RasterTerrain::GetTerrainHeight(GetPanLatitude(), GetPanLongitude());
if (alt==TERRAIN_INVALID) alt=0.0;
_stprintf(Scale2, _T(" %.0f%s "),alt,
Units::GetUnitName(Units::GetUserAltitudeUnit()));
}
double pandistance, panbearing;
if(ValidTaskPoint(PanTaskEdit))
{
_stprintf(Scale, _T("Task %.1f%s"), CALCULATED_INFO.TaskDistanceToGo*DISTANCEMODIFY, Units::GetDistanceName()/*, panbearing,_T(DEG)*/ );
}
else
{
DistanceBearing(DrawInfo.Latitude,DrawInfo.Longitude,GetPanLatitude(),GetPanLongitude(),&pandistance,&panbearing);
_stprintf(Scale, _T(" %.1f%s %.0f%s "), pandistance*DISTANCEMODIFY, Units::GetDistanceName(), panbearing, gettext(_T("[email protected]_")) );
}
_tcscat(Scale2,Scale);
goto _skip1;
}
//
// This stuff is not painted while panning, to save space on screen
//
// warn about missing terrain
if (!DerivedDrawInfo.TerrainValid) {
if (terrainwarning < 120) {
// LKTOKEN [email protected]_ " TERRAIN?"
_tcscat(Scale2, MsgToken(1335));
terrainwarning++;
} else {
//.........这里部分代码省略.........