本文整理汇总了C++中LKSurface::DrawMaskedBitmap方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::DrawMaskedBitmap方法的具体用法?C++ LKSurface::DrawMaskedBitmap怎么用?C++ LKSurface::DrawMaskedBitmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::DrawMaskedBitmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawAirspaceLabels
void MapWindow::DrawAirspaceLabels(LKSurface& Surface, const RECT& rc, const POINT& Orig_Aircraft)
{
static short int label_sequencing_divider = 0;
CAirspaceList::const_iterator it;
const CAirspaceList& airspaces_to_draw = CAirspaceManager::Instance().GetAirspacesForWarningLabels();
if (label_sequencing_divider) --label_sequencing_divider;
// Draw warning position and label on top of all airspaces
if (1) {
CCriticalSection::CGuard guard(CAirspaceManager::Instance().MutexRef());
for (it=airspaces_to_draw.begin(); it != airspaces_to_draw.end(); ++it) {
if ((*it)->WarningLevel() > awNone) {
POINT sc;
double lon;
double lat;
int vdist;
AirspaceWarningDrawStyle_t vlabeldrawstyle, hlabeldrawstyle;
bool distances_ready = (*it)->GetWarningPoint(lon, lat, hlabeldrawstyle, vdist, vlabeldrawstyle);
TCHAR hbuf[NAME_SIZE+16], vDistanceText[16];
TextInBoxMode_t TextDisplayMode = {0};
bool hlabel_draws = false;
bool vlabel_draws = false;
// Horizontal warning point
if (distances_ready && (hlabeldrawstyle > awsHidden) && PointVisible(lon, lat)) {
LatLon2Screen(lon, lat, sc);
Surface.DrawMaskedBitmap(sc.x - NIBLSCALE(5), sc.y - NIBLSCALE(5), IBLSCALE(10), IBLSCALE(10), hAirspaceWarning, 10, 10);
Units::FormatUserAltitude(vdist, vDistanceText, sizeof(vDistanceText)/sizeof(vDistanceText[0]));
_tcscpy(hbuf, (*it)->Name());
_tcscat(hbuf, TEXT(" "));
_tcscat(hbuf, vDistanceText);
switch (hlabeldrawstyle) {
default:
case awsHidden:
case awsBlack:
TextDisplayMode.Color = RGB_BLACK;
break;
case awsAmber:
TextDisplayMode.Color = RGB_ORANGE;
break;
case awsRed:
TextDisplayMode.Color = RGB_RED;
break;
} // sw
TextDisplayMode.SetTextColor = 1;
TextDisplayMode.AlligneCenter = 1;
if ( (MapBox == (MapBox_t)mbBoxed) || (MapBox == (MapBox_t)mbBoxedNoUnit)) {
TextDisplayMode.Border = 1;
} else {
if (TextDisplayMode.Color==RGB_BLACK)
TextDisplayMode.WhiteBold = 0; // no black outline for black background..
else
TextDisplayMode.WhiteBold = 1; // outlined
}
hlabel_draws = TextInBox(Surface, &rc, hbuf, sc.x, sc.y+NIBLSCALE(15), 0, &TextDisplayMode, true);
}
// Vertical warning point
if (distances_ready && vlabeldrawstyle > awsHidden) {
Units::FormatUserAltitude(vdist, vDistanceText, sizeof(vDistanceText)/sizeof(vDistanceText[0]));
_tcscpy(hbuf, (*it)->Name());
_tcscat(hbuf, TEXT(" "));
_tcscat(hbuf, vDistanceText);
switch (vlabeldrawstyle) {
default:
case awsHidden:
case awsBlack:
TextDisplayMode.Color = RGB_BLACK;
break;
case awsAmber:
TextDisplayMode.Color = RGB_ORANGE;
break;
case awsRed:
TextDisplayMode.Color = RGB_RED;
break;
} // sw
TextDisplayMode.SetTextColor = 1;
TextDisplayMode.AlligneCenter = 1;
if ( (MapBox == (MapBox_t)mbBoxed) || (MapBox == (MapBox_t)mbBoxedNoUnit)) {
TextDisplayMode.Border = 1;
} else {
if (TextDisplayMode.Color==RGB_BLACK)
TextDisplayMode.WhiteBold = 0; // no black outline for black background..
else
TextDisplayMode.WhiteBold = 1; // outlined
}
vlabel_draws = TextInBox(Surface, &rc, hbuf, Orig_Aircraft.x, Orig_Aircraft.y+NIBLSCALE(15), 0, &TextDisplayMode, true);
}
if (!label_sequencing_divider) CAirspaceManager::Instance().AirspaceWarningLabelPrinted(**it, hlabel_draws || vlabel_draws);
}// if warnlevel>awnone
}//for
//.........这里部分代码省略.........