本文整理汇总了C++中TDC::FillRect方法的典型用法代码示例。如果您正苦于以下问题:C++ TDC::FillRect方法的具体用法?C++ TDC::FillRect怎么用?C++ TDC::FillRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDC
的用法示例。
在下文中一共展示了TDC::FillRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: DrawDisabledButton
void DrawDisabledButton(TDC& dc, const TRect& rc)
{
// create a monochrome memory DC
//
TMemoryDC ddc;
TBitmap bmp(ddc, rc.Width(), rc.Height());
ddc.SelectObject(bmp);
// build a mask
//
ddc.PatBlt(0, 0, rc.Width(), rc.Height(), WHITENESS);
dc.SetBkColor(TColor::Sys3dFace);
ddc.BitBlt(0, 0, rc.Width(), rc.Height(), dc, rc.left, rc.top, SRCCOPY);
dc.SetBkColor(TColor::Sys3dHilight);
ddc.BitBlt(0, 0, rc.Width(), rc.Height(), dc, rc.left, rc.top, SRCPAINT);
// Copy the image from the toolbar into the memory DC
// and draw it (grayed) back into the toolbar.
//
dc.FillRect(rc, TBrush(TColor::Sys3dFace));
dc.SetBkColor(RGB(0, 0, 0));
dc.SetTextColor(RGB(255, 255, 255));
TBrush brShadow(TColor::Sys3dShadow);
TBrush brHilight(TColor::Sys3dHilight);
dc.SelectObject(brHilight);
dc.BitBlt(rc.left+1, rc.top+1, rc.Width(), rc.Height(), ddc, 0, 0, 0x00E20746L);
dc.SelectObject(brShadow);
dc.BitBlt(rc.left, rc.top, rc.Width(), rc.Height(), ddc, 0, 0, 0x00E20746L);
// reset DCs
//
dc.RestoreBrush();
dc.RestoreBrush();
ddc.RestoreBitmap();
}
示例3: br
void
FillMaskRect(TDC& dc, TRect rect)
{
THatch8x8Brush br(THatch8x8Brush::Hatch11F1, TColor::Sys3dHilight,
TColor::Sys3dFace);
dc.FillRect(rect, br);
}
示例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);
}