本文整理汇总了C++中TDC::SetWindowExt方法的典型用法代码示例。如果您正苦于以下问题:C++ TDC::SetWindowExt方法的具体用法?C++ TDC::SetWindowExt怎么用?C++ TDC::SetWindowExt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDC
的用法示例。
在下文中一共展示了TDC::SetWindowExt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LineViewer
void TSensorView::LineViewer(TDC& dc,PSHORTREAL pData)
{
m_xSize = m_nDimSize[0]-1;
m_ySize = m_nDimSize[1]-1;
m_yAdd = (int) (500L * m_ySize / m_xSize / 2);
dc.SetWindowExt(TSize(m_xSize * 2 + m_ySize,500 + m_yAdd));
Grid3D(dc);
if(m_nDimSize[1] == 1)
for(int x = 0; x < m_nDimSize[0]; x++)
{
TPoint pt = Project2D(x,0,pData[x]);
if (x)
LINE(dc,pt);
else
MOVE(dc,pt);
}
else
{
TBrush br(SYSCOLOR(COLOR_BTNFACE));
dc.SelectObject(br);
for (int y = 0; y < m_nDimSize[1]-1; y++)
for (int x = 0; x < m_nDimSize[0]-1; x++)
{
TPoint pt[4] =
{
Project2D(x,y,pData[x + (LONGINT) m_nDimSize[0] * y]),
Project2D(x+1,y,pData[x+1 + (LONGINT) m_nDimSize[0] * y]),
Project2D(x+1,y+1,pData[x+1 + (LONGINT) m_nDimSize[0] * (y+1)]),
Project2D(x,y+1,pData[x + (LONGINT) m_nDimSize[0] * (y+1)])
};
POLY(dc,pt,4);
}
}
dc.RestorePen();
}
示例2: GreyViewer
void TSensorView::GreyViewer(TDC& dc,PSHORTREAL pData)
{
dc.SetWindowExt(TSize(m_nDimSize[0],m_nDimSize[1]));
for (int y = 0; y < m_nDimSize[1]; y++)
{
int xStart = 0,
x = 0;
int clrLast,
clrThis;
while(x < m_nDimSize[0])
{
SHORTREAL r = pData[x + y * (LONGINT) m_nDimSize[0]];
if (r > 1)
r = 1;
else if (r < 0)
r = 0;
clrThis = (int) (pow(r,m_dBright) * 255);
if(!x)
clrLast = clrThis;
else if(clrThis != clrLast)
{
TBrush br(TColor(clrLast,clrLast,clrLast));
TRect rect(xStart,y,x,y+1);
dc.FillRect(rect,br);
xStart = x;
clrLast = clrThis;
}
x++;
}
TBrush br(TColor(clrLast,clrLast,clrLast));
TRect rect(xStart,y,x,y+1);
dc.FillRect(rect,br);
}
Grid2D(dc);
}
示例3: ColumnViewer
void TSensorView::ColumnViewer(TDC& dc,PSHORTREAL pData)
{
m_xSize = m_nDimSize[0];
m_ySize = m_nDimSize[1];
m_yAdd = (int) (500L * m_ySize / m_xSize / 2);
dc.SetWindowExt(TSize(m_xSize * 2 + m_ySize,500 + m_yAdd));
Grid3D(dc);
TBrush brGray(SYSCOLOR(COLOR_BTNFACE)),
brWhite(SYSCOLOR(COLOR_BTNHIGHLIGHT)),
brDark(SYSCOLOR(COLOR_BTNSHADOW));
for (int y = 0; y < m_nDimSize[1]; y++)
for (int x = 0; x < m_nDimSize[0]; x++)
{
SHORTREAL r = pData[x + (LONGINT) m_nDimSize[0] * y];
TPoint pt[4] =
{
Project2D(x,y+1,r),
Project2D(x+1,y+1,r),
Project2D(x+1,y,r),
Project2D(x,y,r)
};
dc.SelectObject(brWhite);
POLY(dc,pt,4);
SHORTREAL r2 = y == m_nDimSize[1]-1
? 0
: pData[x + (LONGINT) m_nDimSize[0] * (y+1)];
if(r2 < r)
{
pt[2] = Project2D(x+1,y+1,r2);
pt[3] = Project2D(x,y+1,r2);
dc.SelectObject(brGray);
POLY(dc,pt,4);
}
r2 = x == m_nDimSize[0]-1 ? 0
: pData[x+1 + (LONGINT) m_nDimSize[0] * y];
if (r2 < r)
{
pt[0] = Project2D(x+1,y,r);
pt[2] = Project2D(x+1,y+1,r2);
pt[3] = Project2D(x+1,y,r2);
dc.SelectObject(brDark);
POLY(dc,pt,4);
}
}
dc.RestoreBrush();
}
示例4: ColorViewer
void TSensorView::ColorViewer(TDC& dc,PSHORTREAL pData)
{
int zMax = m_nDimSize[m_nDim-1],
xMax = m_nDim > 1 ? m_nDimSize[0] : 1,
yMax = m_nDim > 2 ? m_nDimSize[1] : 1;
dc.SetWindowExt(TSize(xMax,yMax));
for (int y = 0; y < yMax; y++)
{
int xStart = 0,
x = 0;
TColor clrLast,
clrThis;
while(x < xMax)
{
int Color[3] = {0,0,0};
for (int z = 0; z < zMax; z++)
{
SHORTREAL r = pData[x + y * (LONGINT) xMax
+ z * (LONGINT) xMax
* (LONGINT) yMax];
if (r > 1)
r = 1;
else if (r < 0)
r = 0;
Color[z] = (int) (pow(r,m_dBright) * 255);
}
clrThis = TColor(Color[0],Color[1],Color[2]);
if(!x)
clrLast = clrThis;
else if(clrThis != clrLast)
{
TBrush br(clrLast);
TRect rect(xStart,y,x,y+1);
dc.FillRect(rect,br);
xStart = x;
clrLast = clrThis;
}
x++;
}
TBrush br(clrLast);
TRect rect(xStart,y,x,y+1);
dc.FillRect(rect,br);
}
Grid2D(dc);
}