本文整理汇总了C++中LKSurface::SetBackgroundOpaque方法的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface::SetBackgroundOpaque方法的具体用法?C++ LKSurface::SetBackgroundOpaque怎么用?C++ LKSurface::SetBackgroundOpaque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LKSurface
的用法示例。
在下文中一共展示了LKSurface::SetBackgroundOpaque方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawNoData
void Statistics::DrawNoData(LKSurface& Surface, const RECT& rc) {
SIZE tsize;
TCHAR text[80];
// LKTOKEN [email protected]_ = "No data"
_stprintf(text,TEXT("%s"), gettext(TEXT("[email protected]_")));
Surface.GetTextSize(text, _tcslen(text), &tsize);
int x = (int)(rc.left+rc.right-tsize.cx)/2;
int y = (int)(rc.top+rc.bottom-tsize.cy)/2;
#if (WINDOWSPC>0)
Surface.SetBackgroundOpaque();
#endif
Surface.DrawText(x, y, text, _tcslen(text));
Surface.SetBackgroundTransparent();
}
示例2: RenderTask
//.........这里部分代码省略.........
lon2 = WayPointList[Task[1].Index].Longitude;
#ifndef UNDITHER
RenderFAISector ( Surface, rc, lat1, lon1, lat2, lon2, lat_c, lon_c,1, RGB_LIGHTYELLOW );
RenderFAISector ( Surface, rc, lat1, lon1, lat2, lon2, lat_c, lon_c,0, RGB_LIGHTCYAN );
#else
RenderFAISector ( Surface, rc, lat1, lon1, lat2, lon2, lat_c, lon_c,1, RGB_LIGHTGREY );
RenderFAISector ( Surface, rc, lat1, lon1, lat2, lon2, lat_c, lon_c,0, RGB_GREY );
#endif
}
}
// draw task lines and label
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(Surface, rc, x1, y1, x2, y2, STYLE_BLUETHIN);
#if (WINDOWSPC>0)
Surface.SetBackgroundOpaque();
#endif
TCHAR text[100];
Surface.SetTextColor(RGB_BLUE);
/*
if ((i==nwps-1) && (Task[i].Index == Task[0].Index))
{
_stprintf(text,TEXT("%0d"),1);
DrawLabel(hdc, rc, text, x1+(x2-x1)/2, y1+(y2-y1)/2);
}
else */
{
_stprintf(text,TEXT("%0d"),i);
DrawLabel(Surface, rc, text, x1+(x2-x1)/2, y1+(y2-y1)/2);
}
if ((i==ActiveTaskPoint)&&(!AATEnabled))
{
lat1 = GPS_INFO.Latitude;
lon1 = GPS_INFO.Longitude;
x1 = (lon1-lon_c)*fastcosine(lat1);
y1 = (lat1-lat_c);
DrawLine(Surface, rc, x1, y1, x2, y2, STYLE_REDTHICK);
}
}
}
// draw aat task line
if (AATEnabled)
{
for (i=MAXTASKPOINTS-1; i>0; i--)
{
示例3: RenderSpeed
void Statistics::RenderSpeed(LKSurface& Surface, const RECT& rc)
{
if ((flightstats.Task_Speed.sum_n<2)
|| !ValidTaskPoint(ActiveTaskPoint)) {
DrawNoData(Surface, rc);
return;
}
ResetScale();
ScaleXFromData(rc, &flightstats.Task_Speed);
ScaleYFromData(rc, &flightstats.Task_Speed);
ScaleYFromValue(rc, 0);
ScaleXFromValue(rc, flightstats.Task_Speed.x_min+1.0); // in case no data
ScaleXFromValue(rc, flightstats.Task_Speed.x_min);
for(int j=1;j<MAXTASKPOINTS;j++) {
if (ValidTaskPoint(j) && (flightstats.LegStartTime[j]>=0)) {
double xx =
(flightstats.LegStartTime[j]-CALCULATED_INFO.TaskStartTime)/3600.0;
if (xx>=0) {
DrawLine(Surface, rc,
xx, y_min,
xx, y_max,
STYLE_REDTHICK);
}
}
}
DrawXGrid(Surface, rc,
0.5, flightstats.Task_Speed.x_min,
STYLE_THINDASHPAPER, 0.5, true);
/* DrawYGrid(hdc, rc, 10/TASKSPEEDMODIFY, 0, STYLE_THINDASHPAPER,
10, true);*/
if(Units::GetUserHorizontalSpeedUnit() == unStatuteMilesPerHour) {
DrawYGrid(Surface, rc, 5.0/TASKSPEEDMODIFY, 0, STYLE_THINDASHPAPER, 5.0, true);
} else {
DrawYGrid(Surface, rc, 10/TASKSPEEDMODIFY, 0, STYLE_THINDASHPAPER, 10, true);
}
DrawLineGraph(Surface, rc, &flightstats.Task_Speed,STYLE_MEDIUMBLACK);
DrawTrend(Surface, rc, &flightstats.Task_Speed, STYLE_BLUETHIN);
if(INVERTCOLORS || IsDithered())
Surface.SetTextColor(RGB_DARKGREEN);
else
Surface.SetTextColor(RGB_GREEN);
Surface.SetBackgroundOpaque();
TCHAR text[80];
DrawXLabel(Surface, rc, TEXT(" t/h "));
_stprintf(text,TEXT(" v/%s "),Units::GetHorizontalSpeedName());
DrawYLabel(Surface, rc, text);
// DrawXLabel(hdc, rc, TEXT("t"));
// DrawYLabel(hdc, rc, TEXT("V"));
}
示例4: RenderTemperature
void Statistics::RenderTemperature(LKSurface& Surface, const RECT& rc)
{
ResetScale();
int i;
float hmin= 10000;
float hmax= -10000;
float tmin= (float)CuSonde::maxGroundTemperature;
float tmax= (float)CuSonde::maxGroundTemperature;
// find range for scaling of graph
for (i=0; i<CUSONDE_NUMLEVELS-1; i++) {
if (CuSonde::cslevels[i].nmeasurements) {
hmin = min(hmin, (float)i);
hmax = max(hmax, (float)i);
tmin = min(tmin, (float)min(CuSonde::cslevels[i].tempDry,
(double)min(CuSonde::cslevels[i].airTemp,
(double)CuSonde::cslevels[i].dewpoint)));
tmax = max(tmax, (float)max(CuSonde::cslevels[i].tempDry,
(double)max(CuSonde::cslevels[i].airTemp,
(double)CuSonde::cslevels[i].dewpoint)));
}
}
if (hmin>= hmax) {
DrawNoData(Surface, rc);
return;
}
ScaleYFromValue(rc, hmin);
ScaleYFromValue(rc, hmax);
ScaleXFromValue(rc, tmin);
ScaleXFromValue(rc, tmax);
bool labelDry = false;
bool labelAir = false;
bool labelDew = false;
int ipos = 0;
for (i=0; i<CUSONDE_NUMLEVELS-1; i++) {
if (CuSonde::cslevels[i].nmeasurements &&
CuSonde::cslevels[i+1].nmeasurements) {
ipos++;
DrawLine(Surface, rc,
CuSonde::cslevels[i].tempDry, i,
CuSonde::cslevels[i+1].tempDry, (i+1),
STYLE_REDTHICK);
DrawLine(Surface, rc,
CuSonde::cslevels[i].airTemp, i,
CuSonde::cslevels[i+1].airTemp, (i+1),
STYLE_MEDIUMBLACK);
DrawLine(Surface, rc,
CuSonde::cslevels[i].dewpoint, i,
CuSonde::cslevels[i+1].dewpoint, i+1,
STYLE_BLUETHIN);
if (ipos> 2) {
if (!labelDry) {
DrawLabel(Surface, rc, TEXT("DALR"),
CuSonde::cslevels[i+1].tempDry, i);
labelDry = true;
} else {
if (!labelAir) {
DrawLabel(Surface, rc, TEXT("Air"),
CuSonde::cslevels[i+1].airTemp, i);
labelAir = true;
} else {
if (!labelDew) {
DrawLabel(Surface, rc, TEXT("Dew"),
CuSonde::cslevels[i+1].dewpoint, i);
labelDew = true;
}
}
}
}
}
}
if(INVERTCOLORS)
Surface.SetTextColor(RGB_DARKGREEN);
else
Surface.SetTextColor(RGB_GREEN);
#if (WINDOWSPC>0)
Surface.SetBackgroundOpaque();
#endif
TCHAR text[80];
_stprintf(text,TEXT(" T/%sC "), gettext(_T("[email protected]_")));
DrawXLabel(Surface, rc, text);
_stprintf(text,TEXT(" h/%s "),Units::GetAltitudeName());
DrawYLabel(Surface, rc, text);
// DrawXLabel(hdc, rc, TEXT("T")TEXT(DEG));
//.........这里部分代码省略.........
示例5: DrawYGrid
void Statistics::DrawYGrid(LKSurface& Surface, const RECT& rc,
const double tic_step,
const double zero,
const int Style,
const double unit_step, bool draw_units) {
POINT line[2];
SIZE tsize;
double yval;
if(INVERTCOLORS || IsDithered())
Surface.SelectObject(LK_BLACK_PEN);
int xmin, ymin, xmax, ymax;
if (!tic_step) return;
for (yval=zero; yval<= y_max; yval+= tic_step) {
xmin = rc.left;
ymin = (int)((y_max-yval)*yscale)+rc.top -BORDER_Y;
xmax = rc.right;
ymax = ymin;
line[0].x = xmin+BORDER_X;
line[0].y = ymin;
line[1].x = xmax;
line[1].y = ymax;
// STYLE_THINDASHPAPER
if ((yval< y_max) &&
(ymin>=rc.top) && (ymin<=rc.bottom-BORDER_Y)) {
StyleLine(Surface, line[0], line[1], Style, rc);
if (draw_units) {
TCHAR unit_text[MAX_PATH];
FormatTicText(unit_text, yval*unit_step/tic_step, unit_step);
Surface.GetTextSize(unit_text, &tsize);
Surface.SetBackgroundOpaque();
Surface.DrawText(xmin, ymin-tsize.cy/2, unit_text);
Surface.SetBackgroundTransparent();
}
}
}
for (yval=zero-tic_step; yval>= y_min; yval-= tic_step) {
xmin = rc.left;
ymin = (int)((y_max-yval)*yscale)+rc.top-BORDER_Y;
xmax = rc.right;
ymax = ymin;
line[0].x = xmin+BORDER_X;
line[0].y = ymin;
line[1].x = xmax;
line[1].y = ymax;
// STYLE_THINDASHPAPER
if ((yval> y_min) &&
(ymin>=rc.top) && (ymin<=rc.bottom-BORDER_Y)) {
StyleLine(Surface, line[0], line[1], Style, rc);
if (draw_units) {
TCHAR unit_text[MAX_PATH];
FormatTicText(unit_text, yval*unit_step/tic_step, unit_step);
Surface.GetTextSize(unit_text, &tsize);
Surface.SetBackgroundOpaque();
Surface.DrawText(xmin, ymin-tsize.cy/2, unit_text);
Surface.SetBackgroundTransparent();
}
}
}
}
示例6: DrawXGrid
void Statistics::DrawXGrid(LKSurface& Surface, const RECT& rc,
const double tic_step,
const double zero,
const int Style,
const double unit_step, bool draw_units) {
if(INVERTCOLORS || IsDithered())
Surface.SelectObject(LK_BLACK_PEN);
POINT line[2];
double xval;
SIZE tsize;
int xmin, ymin, xmax, ymax;
if (!tic_step) return;
LKASSERT(tic_step!=0);
// bool do_units = ((x_max-zero)/tic_step)<10;
for (xval=zero; xval<= x_max; xval+= tic_step) {
xmin = (int)((xval-x_min)*xscale)+rc.left+BORDER_X;
ymin = rc.top;
xmax = xmin;
ymax = rc.bottom;
line[0].x = xmin;
line[0].y = ymin;
line[1].x = xmax;
line[1].y = ymax-BORDER_Y;
// STYLE_THINDASHPAPER
if ((xval< x_max)
&& (xmin>=rc.left+BORDER_X) && (xmin<=rc.right)) {
StyleLine(Surface, line[0], line[1], Style, rc);
if (draw_units) {
TCHAR unit_text[MAX_PATH];
FormatTicText(unit_text, xval*unit_step/tic_step, unit_step);
// SetBkMode(hdc, OPAQUE);
Surface.GetTextSize(unit_text, &tsize);
Surface.SetBackgroundOpaque();
Surface.DrawText(xmin-tsize.cx/2, ymax-tsize.cy, unit_text);
Surface.SetBackgroundTransparent();
}
}
}
for (xval=zero-tic_step; xval>= x_min; xval-= tic_step) {
xmin = (int)((xval-x_min)*xscale)+rc.left+BORDER_X;
ymin = rc.top;
xmax = xmin;
ymax = rc.bottom;
line[0].x = xmin;
line[0].y = ymin;
line[1].x = xmax;
line[1].y = ymax-BORDER_Y;
// STYLE_THINDASHPAPER
if ((xval> x_min)
&& (xmin>=rc.left+BORDER_X) && (xmin<=rc.right)) {
StyleLine(Surface, line[0], line[1], Style, rc);
if (draw_units) {
TCHAR unit_text[MAX_PATH];
FormatTicText(unit_text, xval*unit_step/tic_step, unit_step);
// SetBkMode(hdc, OPAQUE);
Surface.GetTextSize(unit_text, &tsize);
Surface.SetBackgroundOpaque();
Surface.DrawText(xmin-tsize.cx/2, ymax-tsize.cy, unit_text);
Surface.SetBackgroundTransparent();
}
}
}
}
示例7: RenderNearAirspace
//.........这里部分代码省略.........
switch (GetMMNorthUp(getsideviewpage)) {
case NORTHUP:
default:
DrawXGrid(Surface, rc, xtick / DISTANCEMODIFY, xtick, 0, TEXT_ABOVE_LEFT, RGB_BLACK, &sDia, text);
break;
case TRACKUP:
DrawXGrid(Surface, rci, xtick / DISTANCEMODIFY, xtick, 0, TEXT_ABOVE_LEFT, RGB_BLACK, &sDia, text);
break;
}
Surface.SetTextColor(Sideview_TextColor);
double fHeight = (sDia.fYMax - sDia.fYMin);
double ytick = 100.0;
if (fHeight > 500.0) ytick = 200.0;
if (fHeight > 1000.0) ytick = 500.0;
if (fHeight > 2000.0) ytick = 1000.0;
if (fHeight > 4000.0) ytick = 2000.0;
if (fHeight > 8000.0) ytick = 4000.0;
if (Units::GetUserAltitudeUnit() == unFeet)
ytick = ytick * FEET_FACTOR;
_stprintf(text, TEXT("%s"), Units::GetUnitName(Units::GetUserAltitudeUnit()));
if (sDia.fYMin < GC_SEA_LEVEL_TOLERANCE)
rc.bottom -= SV_BORDER_Y; /* scale witout sea */
DrawYGrid(Surface, rc, ytick / ALTITUDEMODIFY, ytick, 0, TEXT_UNDER_RIGHT, Sideview_TextColor, &sDia, text);
Surface.SetBkColor(RGB_WHITE);
if (!bInvCol)
Surface.SetBackgroundOpaque();
/****************************************************************************************************
* draw AGL
****************************************************************************************************/
if (calc_altitudeagl - sDia.fYMin > 500) {
Surface.SetTextColor(LIGHTBLUE_COL);
Units::FormatUserAltitude(calc_altitudeagl, buffer, 7);
LK_tcsncpy(text, MsgToken(1742), TBSIZE - _tcslen(buffer)); // AGL:
_tcscat(text, buffer);
Surface.GetTextSize(text, &tsize);
TxYPt.x = CalcDistanceCoordinat(0, &sDia) - tsize.cx / 2;
TxYPt.y = CalcHeightCoordinat((calc_terrainalt + calc_altitudeagl)*0.8, &sDia);
if ((tsize.cy) < (CalcHeightCoordinat(calc_terrainalt, &sDia) - TxYPt.y)) {
Surface.DrawText(TxYPt.x + IBLSCALE(1), TxYPt.y, text);
}
}
Surface.SetBackgroundTransparent();
/****************************************************************************************************
* Print current Elevation
****************************************************************************************************/
Surface.SetTextColor(RGB_BLACK);
int x, y;
if ((calc_terrainalt - sDia.fYMin) > 0) {
Units::FormatUserAltitude(calc_terrainalt, buffer, 7);
LK_tcsncpy(text, MsgToken(1743), TBSIZE - _tcslen(buffer)); // ELV:
_tcscat(text, buffer);
Surface.GetTextSize(text, &tsize);
x = CalcDistanceCoordinat(0, &sDia) - tsize.cx / 2;
y = CalcHeightCoordinat(calc_terrainalt, &sDia);
if ((ELV_FACT * tsize.cy) < abs(rc.bottom - y)) {
Surface.DrawText(x, rc.bottom - (int) (ELV_FACT * tsize.cy), text);