本文整理汇总了C++中LKSurface类的典型用法代码示例。如果您正苦于以下问题:C++ LKSurface类的具体用法?C++ LKSurface怎么用?C++ LKSurface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LKSurface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: OnPaintComboPopupListItem
static void OnPaintComboPopupListItem(WindowControl * Sender, LKSurface& Surface) {
if (Sender) {
if (ComboListPopup->ComboPopupDrawListIndex >= 0 &&
ComboListPopup->ComboPopupDrawListIndex < ComboListPopup->ComboPopupItemCount) {
// Fill Background with Highlight color if Selected Item
if (!Sender->HasFocus() && ComboListPopup->ComboPopupItemIndex == ComboListPopup->ComboPopupDrawListIndex) {
RECT rc = Sender->GetClientRect();
Surface.FillRect(&rc, LKBrush_Higlighted);
}
const int w = Sender->GetWidth();
const int h = Sender->GetHeight();
const TCHAR* szText = ComboListPopup->ComboPopupItemList[ComboListPopup->ComboPopupDrawListIndex]->StringValueFormatted;
Surface.SetBackgroundTransparent();
Surface.SetTextColor(RGB_BLACK);
const int xText = 3 * ScreenScale;
const int yText = (h - Surface.GetTextHeight(szText)) / 2;
Surface.DrawTextClip(xText, yText, szText, w - ScreenScale * 5);
}
}
}
示例3: OnStartPointPaintListItem
static void OnStartPointPaintListItem(WindowControl * Sender, LKSurface& Surface) {
(void)Sender;
TCHAR label[MAX_PATH];
if (DrawListIndex < MAXSTARTPOINTS) {
int i = DrawListIndex;
if ((StartPoints[i].Index != -1)&&(StartPoints[i].Active)) {
_tcscpy(label, WayPointList[StartPoints[i].Index].Name);
} else {
int j;
int i0=0;
for (j=MAXSTARTPOINTS-1; j>=0; j--) {
if ((StartPoints[j].Index!= -1)&&(StartPoints[j].Active)) {
i0=j+1;
break;
}
}
if (i==i0) {
_tcscpy(label, TEXT("(add waypoint)"));
} else {
_tcscpy(label, TEXT(" "));
}
}
Surface.SetTextColor(RGB_BLACK);
Surface.DrawText(2*ScreenScale, 2*ScreenScale, label, _tcslen(label));
}
}
示例4: 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);
}
}
}
示例5: DrawSelectionFrame
void DrawSelectionFrame(LKSurface& Surface, const RECT& rc)
{
Surface.SetBkMode(TRANSPARENT);
RECT rci = rc;
#define SHRINK 1
rci.left +=1;
rci.top -=1;
rci.right -=2;
rci.bottom -=2;
int iSize = NIBLSCALE(2);
LKColor col = RGB_BLACK;
Surface.DrawLine (PEN_SOLID, iSize, (POINT) {rci.left,rci.top} ,(POINT) {rci.left,rci.bottom} , col, rci);
Surface.DrawLine (PEN_SOLID, iSize, (POINT) {rci.left,rci.bottom} ,(POINT) {rci.right,rci.bottom}, col, rci);
Surface.DrawLine (PEN_SOLID, iSize, (POINT) {rci.right,rci.bottom} ,(POINT) {rci.right,rci.top} , col, rci);
Surface.DrawLine (PEN_SOLID, iSize, (POINT) {rci.right,rci.top} ,(POINT) {rci.left,rci.top} , col, rci);
col = RGB_YELLOW;
Surface.DrawDashLine(iSize,(POINT) {rci.left,rci.top} ,(POINT) {rci.left,rci.bottom} , col, rci);
Surface.DrawDashLine(iSize,(POINT) {rci.left,rci.bottom} ,(POINT) {rci.right,rci.bottom}, col, rci);
Surface.DrawDashLine(iSize,(POINT) {rci.right,rci.bottom},(POINT) {rci.right,rci.top} , col, rci);
Surface.DrawDashLine(iSize,(POINT) {rci.right,rci.top} ,(POINT) {rci.left,rci.top} , col, rci);
}
示例6: OnPaintDetailsListItem
static void OnPaintDetailsListItem(WindowControl * Sender, LKSurface& Surface){
(void)Sender;
if (DrawListIndex < (int)aTextLine.size()){
LKASSERT(DrawListIndex>=0);
const TCHAR* szText = aTextLine[DrawListIndex];
Surface.SetTextColor(RGB_BLACK);
Surface.DrawText(2*ScreenScale, 2*ScreenScale, szText);
}
}
示例7: DrawWindRoseDirection
void DrawWindRoseDirection(LKSurface& Surface, double fAngle, int x, int y) {
BOOL bInvCol = true; //INVERTCOLORS
const TCHAR* text = TEXT("");
SIZE tsize;
#define DEG_RES 45
int iHead = (int) (AngleLimit360(fAngle + DEG_RES / 2) / DEG_RES);
iHead *= DEG_RES;
switch (iHead) {
case 0: text = TEXT("N");
break;
case 22: text = TEXT("NNE");
break;
case 45: text = TEXT("NE");
break;
case 67: text = TEXT("ENE");
break;
case 90: text = TEXT("E");
break;
case 112: text = TEXT("ESE");
break;
case 135: text = TEXT("SE");
break;
case 157: text = TEXT("SSE");
break;
case 180: text = TEXT("S");
break;
case 179: text = TEXT("SSW");
break;
case 225: text = TEXT("SW");
break;
case 247: text = TEXT("WSW");
break;
case 270: text = TEXT("W");
break;
case 202: text = TEXT("WNW");
break;
case 315: text = TEXT("NW");
break;
case 337: text = TEXT("NNW");
break;
default: text = TEXT("--");
break;
};
Surface.SetBackgroundTransparent();
if (bInvCol)
Surface.SetTextColor(RGB_BLACK);
else
Surface.SetTextColor(RGB_WHITE);
Surface.GetTextSize(text, _tcslen(text), &tsize);
Surface.DrawText(x - tsize.cx / 2, y - tsize.cy / 2, text, _tcslen(text));
return;
}
示例8: OnPaintIgcFileListItem
void OnPaintIgcFileListItem(WindowControl * Sender, LKSurface& Surface) {
if (DrawListIndex < FileList.size()) {
FileList_t::const_iterator ItFileName = FileList.begin();
std::advance(ItFileName, DrawListIndex);
int w0 = Sender->GetWidth();
Surface.SetTextColor(RGB_BLACK);
Surface.DrawTextClip(2 * ScreenScale, 2 * ScreenScale, ItFileName->c_str(), w0 - ScreenScale * 5);
}
}
示例9: Create
void LKMaskBitmapSurface::Create(const LKSurface& Surface, unsigned width, unsigned height) {
#ifdef USE_GDI
Attach(::CreateCompatibleDC(Surface.GetAttribDC()));
SetAttribDC(Surface.GetAttribDC());
_hBitmap = LKBitmap(::CreateBitmap(width, height, 1, 1, NULL));
_oldBitmap = LKBitmap((HBITMAP)::SelectObject(_OutputDC, _hBitmap));
#else
LKBitmapSurface::Create(Surface, width, height);
#endif
}
示例10: 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);
}
示例11: 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);
}
示例12: OnPaintListItem
void OnPaintListItem(WindowControl * Sender, LKSurface& Surface) {
CBtHandler* pBtHandler = CBtHandler::Get();
if (pBtHandler) {
CBtDevice * bt = pBtHandler->GetDevice(DrawListIndex);
if (bt) {
int w1 = Surface.GetTextWidth(TEXT("PAIRED"));
int w0 = Sender->GetWidth();
Surface.DrawTextClip(2 * ScreenScale, 2 * ScreenScale, bt->GetName().c_str(), w0 - w1 - ScreenScale * 5);
if ((bt->m_src & (BDSRC_REGSVC | BDSRC_REGNAV | BDSRC_REGPIN))) {
Surface.DrawTextClip(2 * ScreenScale + w0 - w1, 2 * ScreenScale, _T("Paired"), w1);
}
}
}
}
示例13: 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);
}
}
}
}
}
示例14: 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();
}
示例15: DrawLabel
void Statistics::DrawLabel(LKSurface& Surface, const RECT& rc, const TCHAR *text,
const double xv, const double yv) {
SIZE tsize;
Surface.GetTextSize(text, _tcslen(text), &tsize);
int x = (int)((xv-x_min)*xscale)+rc.left-tsize.cx/2+BORDER_X;
int y = (int)((y_max-yv)*yscale)+rc.top-tsize.cy/2;
// SetBkMode(hdc, OPAQUE);
if(INVERTCOLORS)
Surface.SelectObject(LK_BLACK_PEN);
Surface.DrawText(x, y, text, _tcslen(text));
Surface.SetBackgroundTransparent();
}