本文整理汇总了C++中Rect::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::Height方法的具体用法?C++ Rect::Height怎么用?C++ Rect::Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::Height方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resizeZoom
/*
* Creates a new (empty) pixel buffer, and fills it.
*/
void ZoomView::resizeZoom()
{
Rect bounds = GetBounds();
if(m_Bitmap) {
// If the window is smaller, there's no need
// to reallocate the bitmap.
// Comment out this to save memory. (by freeing unused
// bitmap space, though it will make resizing slower).
if(bounds.Width() <= m_Bitmap->GetBounds().Width() &&
bounds.Height() <= m_Bitmap->GetBounds().Height()) {
return; // No reallocation necessary
}
delete m_Bitmap;
}
m_Bitmap = new Bitmap((int)(bounds.Width())+1, (int)(bounds.Height())+1, m_ColSpace, Bitmap::SHARE_FRAMEBUFFER);
// Note: The +1's are necessary, since the Bitmap constructor creates
// a bitmap that is 1 pixel smaller in both directions, for some reason.
// (Bitmap->GetBounds().Width() returns 1 less than the width you ask
// for, same with ...Height()).
fetchPixels();
}
示例2: MoveWnd
/*----------------------------------------------------------------------------------------------
Move/resize the edit and button windows.
@param rcClip
----------------------------------------------------------------------------------------------*/
void AfDeFeEdBoxBut::MoveWnd(const Rect & rcClip)
{
::MoveWindow(m_hwnd, rcClip.left + 2, rcClip.top + 1,
rcClip.Width() - 2, rcClip.Height() - 1, true);
Rect rc;
::GetClientRect(m_hwnd, &rc);
rc.left = rc.right - 16;
rc.bottom = rc.top + Min((int)rc.bottom - (int)rc.top, (int)kdxpButtonHeight);
::MoveWindow(m_hwndButton, rc.left, rc.top, rc.Width(), rc.Height(), true);
#if 1-1
// Now resize the edit window so it doesn't actually include the button, just for laughs.
::MoveWindow(m_hwnd, rcClip.left + 2, rcClip.top + 1,
rcClip.Width() - 20, rcClip.Height() - 1, // width - 2 (for margin) - 18 (for button)
true);
#endif
#if 99-99
Rect rcEditNew;
Rect rcEditNewClient;
Rect rcBut;
Rect rcButClient;
::GetWindowRect(m_hwnd, &rcEditNew);
::GetClientRect(m_hwnd, &rcEditNewClient);
::GetWindowRect(m_hwndButton, &rcBut);
::GetClientRect(m_hwndButton, &rcButClient);
#endif
}
示例3:
CliWindow::CliWindow (const Rect& bounds)
: _offset(bounds.TopLeft())
, _background(BLACK)
, _foreground(WHITE)
, _canvas(new uint16_t[bounds.Width()*bounds.Height()], bounds.Width(), bounds.Height())
{
}
示例4: UpdateCellBounds
void GuiTableComposition::UpdateCellBounds()
{
rowOffsets.Resize(rows);
rowSizes.Resize(rows);
columnOffsets.Resize(columns);
columnSizes.Resize(columns);
vint rowTotal = (rows - 1) * cellPadding;
vint columnTotal = (columns - 1) * cellPadding;
vint rowTotalWithPercentage = rowTotal;
vint columnTotalWithPercentage = columnTotal;
UpdateCellBoundsInternal(
rowSizes,
rowTotal,
rowTotalWithPercentage,
rowOptions,
&GuiTableComposition::rows,
&GuiTableComposition::columns,
&Y,
&RL,
&RS,
&First,
&Second,
1
);
UpdateCellBoundsInternal(
columnSizes,
columnTotal,
columnTotalWithPercentage,
columnOptions,
&GuiTableComposition::columns,
&GuiTableComposition::rows,
&X,
&CL,
&CS,
&Second,
&First,
1
);
Rect area = GetCellArea();
UpdateCellBoundsPercentages(rowSizes, rowTotal, area.Height(), rowOptions);
UpdateCellBoundsPercentages(columnSizes, columnTotal, area.Width(), columnOptions);
rowExtending = UpdateCellBoundsOffsets(rowOffsets, rowSizes, area.Height());
columnExtending = UpdateCellBoundsOffsets(columnOffsets, columnSizes, area.Width());
for (vint i = 0; i < rows; i++)
{
for (vint j = 0; j < columns; j++)
{
vint index = GetSiteIndex(rows, columns, i, j);
cellBounds[index] = Rect(Point(columnOffsets[j], rowOffsets[i]), Size(columnSizes[j], rowSizes[i]));
}
}
tableContentMinSize = Size(columnTotalWithPercentage, rowTotalWithPercentage);
InvokeOnCompositionStateChanged();
}
示例5: Paint
virtual void Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword style) const
{
Font fnt = Font(q, r.Height() - 2);
String txt = Font::GetFaceName(q);
w.DrawRect(r, paper);
w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink);
}
示例6: Paint
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const {
ValueArray va = q;
String txt = va[0];
Image icon = va[1];
w.DrawRect(r, paper);
w.DrawImage(r.left, r.top + (r.Height() - 16) / 2, IsNull(icon) ? IdeImg::Package() : icon);
w.DrawText(r.left + 20, r.top + (r.Height() - Draw::GetStdFontCy()) / 2, txt, fnt, ink);
}
示例7: RenderCheck
void Checkbox::RenderCheck(Rect& rectArea)
{
Rect rectBox = rectArea;
int iBoxMargin = int(rectArea.Height() * 0.2);
int iBoxMarginRight = int(rectArea.Height() * 0.8 * 0.75);
rectBox.Left(rectBox.Left() + iBoxMargin);
rectBox.Right(rectBox.Left() + iBoxMarginRight);
rectBox.Top(rectBox.Top() + iBoxMargin);
rectBox.Bottom(rectBox.Bottom() - iBoxMargin);
OpenGL::PushedAttributes attr(GL_ENABLE_BIT | GL_LINE_BIT | GL_POINT_BIT);
glDisable(GL_TEXTURE_2D);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POINT_SMOOTH);
Color cBox = GetAttrAsColor(CheckboxAttr::BoxColor);
glColor4ubv(cBox.m_color);
glLineWidth(2.0);
glBegin(GL_LINE_LOOP);
glVertex2i(rectBox.Left(), rectBox.Bottom());
glVertex2i(rectBox.Right(), rectBox.Bottom());
glVertex2i(rectBox.Right(), rectBox.Top());
glVertex2i(rectBox.Left(), rectBox.Top());
glEnd();
if (IsChecked())
{
double iCheckUnit = rectBox.Height() * 0.1;
Point point1(int(rectBox.Left() + 3 * iCheckUnit), int(rectBox.Bottom() - 6 * iCheckUnit));
Point point2(int(rectBox.Left() + 6 * iCheckUnit), int(rectBox.Bottom() - 3 * iCheckUnit));
Point point3(int(rectBox.Left() + 11* iCheckUnit), int(rectBox.Bottom() - 11* iCheckUnit));
Color cCheck = GetAttrAsColor(CheckboxAttr::CheckColor);
glColor4ubv(cCheck.m_color);
glLineWidth(4.0);
glBegin(GL_LINES);
glVertex2i(point1.X(), point1.Y());
glVertex2i(point2.X(), point2.Y());
glVertex2i(point2.X(), point2.Y());
glVertex2i(point3.X(), point3.Y());
glEnd();
glPointSize(3.0);
glBegin(GL_POINTS);
glVertex2i(point1.X(), point1.Y());
glVertex2i(point2.X(), point2.Y());
glVertex2i(point3.X(), point3.Y());
glEnd();
}
// adjust rect for size of checkbox
int iOffset = int(rectArea.Height() * 1.1);
rectArea.Left(rectArea.Left() + iOffset);
}
示例8: Image
//-----------------------------------------------------------------------------------------------------------------------------------------------------
Ptr<Image> Context::ReadFrameBuffer(Rect R)
{
Image* pImage = new Image( R.Width(), R.Height() );
glReadPixels( R.left, R.top, R.Width(), R.Height(), GL_BGRA, GL_UNSIGNED_BYTE, (Color*)(*pImage) );
VerifyOpenGLErrorState();
return pImage;
}
示例9: ImageF
//-----------------------------------------------------------------------------------------------------------------------------------------------------
Ptr<ImageF> Context::ReadFloatFrameBuffer(Rect R)
{
ImageF* pImage = new ImageF( R.Width(), R.Height() );
glReadPixels( R.left, R.top, R.Width(), R.Height(), GL_RGBA, GL_FLOAT, (ColorF*)(*pImage) );
VerifyOpenGLErrorState();
return pImage;
}
示例10: switch
LRESULT Trackbar::OnCustomDraw(NMCUSTOMDRAW& customDraw)
{
switch (customDraw.dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW | CDRF_NOTIFYPOSTERASE;
}
switch (customDraw.dwItemSpec)
{
case TBCD_CHANNEL: // seems to be the most reliable place to draw the background
{
Rect clientRect = this->ClientRect();
if (::GetBkMode(customDraw.hdc) != TRANSPARENT)
{
HBRUSH brush = ::CreateSolidBrush(Color::SystemColor(COLOR_BTNFACE));
::FillRect(customDraw.hdc, &(RECT)clientRect, brush);
::DeleteObject(brush);
}
// windows doesn't automatically center the track vertically if no ticks
// are visible on the trackbar.
if (this->tickFrequency == 0)
{
Rect channelRect = customDraw.rc;
//
channelRect.location.y = (clientRect.Height() - channelRect.Height()) / 2;
customDraw.rc = channelRect;
}
short topOffset = this->trackHeight / 2;
customDraw.rc.top -= (topOffset);
customDraw.rc.bottom += (this->trackHeight - topOffset);
}
break;
case TBCD_THUMB:
{
// center the thumb vertically if no ticks are visible
if (this->tickFrequency == 0)
{
Rect clientRect = this->ClientRect();
Rect channelRect = customDraw.rc;
channelRect.location.y = (clientRect.Height() - channelRect.Height()) / 2;
customDraw.rc = channelRect;
}
}
break;
case TBCD_TICS:
break;
}
return CDRF_DODEFAULT;
}
示例11: Render
void GuiSolidLabelElementRenderer::Render(Rect bounds)
{
if(cairoContext)
{
cairo_save(cairoContext);
Color color = element->GetColor();
FontProperties font = element->GetFont();
cairo_set_source_rgba(cairoContext,
1.0 * color.r / 255,
1.0 * color.g / 255,
1.0 * color.b / 255,
1.0 * color.a / 255
);
if(element->GetWrapLine()) pango_layout_set_width(layout, bounds.Width() * PANGO_SCALE);
pango_cairo_update_layout(cairoContext, layout);
int layoutWidth, layoutHeight;
int plotX1, plotY1;
pango_layout_get_pixel_size( layout, &layoutWidth, &layoutHeight);
switch(element->GetHorizontalAlignment())
{
case Alignment::Left:
plotX1 = bounds.x1;
break;
case Alignment::Center:
plotX1 = bounds.x1 + (bounds.Width() - layoutWidth) / 2;
break;
case Alignment::Right:
plotX1 = bounds.x1 + (bounds.Width() - layoutWidth);
break;
}
switch(element->GetVerticalAlignment())
{
case Alignment::Top:
plotY1 = bounds.y1;
break;
case Alignment::Center:
plotY1 = bounds.y1 + (bounds.Height() - layoutHeight) / 2;
break;
case Alignment::Bottom:
plotY1 = bounds.y1 + (bounds.Height() - layoutHeight);
break;
}
cairo_move_to(cairoContext, plotX1, plotY1);
pango_cairo_layout_path(cairoContext, layout);
cairo_fill(cairoContext);
cairo_restore(cairoContext);
}
}
示例12: hScreen
void Dow::Handle::CenterOverScreen (int xOff, int yOff)
{
Dow::Handle hScreen (GetDesktopWindow ());
Rect screenRect;
hScreen.GetWindowRect (screenRect);
Rect myRect;
GetWindowRect (myRect);
int x = xOff + (screenRect.Width () - myRect.Width ()) / 2;
int y = yOff + (screenRect.Height () - myRect.Height ()) / 2;
MoveDelayPaint (x, y, myRect.Width (), myRect.Height ());
}
示例13: OnPaint
void ListControl::OnPaint(DibBitmap *pbm)
{
Rect rcForm;
m_pfrm->GetRect(&rcForm);
Rect rc;
Rect rcScrollPos;
GetSubRects(&rc, NULL, NULL, &rcScrollPos);
rc.Offset(rcForm.left, rcForm.top);
rcScrollPos.Offset(rcForm.left, rcForm.top);
Size sizArrow;
s_ptbmScrollUpUp->GetSize(&sizArrow);
int cliDraw = GetVisibleItemCount();
int cx = rc.Width();
int x = rc.left;
int y = rc.top;
int xArrow = rc.left + ((cx - sizArrow.cx) / 2);
// Walk through the list to the item that should be displayed first
ListItem *pli;
int ili = 0;
for (pli = m_pliFirst; ili < m_iliTop; pli = pli->pliNext, ili++);
int cliDrawn = 0;
for (; pli != NULL && cliDraw > 0;
pli = pli->pliNext, y += m_cyItem, cliDraw--) {
DrawItem(pbm, pli, x, y, cx, m_cyItem);
cliDrawn++;
}
bool fNeedsScrollUp = NeedsScrollUpArrow();
bool fNeedsScrollDown = NeedsScrollDownArrow();
if (m_wf & kfLstcScrollPosition) {
if (fNeedsScrollUp || fNeedsScrollDown) {
pbm->Shadow(rcScrollPos.left, rcScrollPos.top, rcScrollPos.Width(),
rcScrollPos.Height());
pbm->Shadow(rcScrollPos.left, rcScrollPos.top, rcScrollPos.Width(),
rcScrollPos.Height());
int y1 = rcScrollPos.Height() * m_iliTop / m_cli;
int y2 = rcScrollPos.Height() * (m_iliTop + cliDrawn) / m_cli;
pbm->Fill(rcScrollPos.left, rcScrollPos.top + y1,
rcScrollPos.Width(), y2 - y1,
#if 0
m_fPenDown ? GetColor(kiclrWhite) :
GetColor(m_iclrScrollPos));
#else
GetColor(m_iclrScrollPos));
#endif
}
} else {
示例14: Paint
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink, Color paper, dword style) const {
ValueArray va = q;
String txt = va[0];
Image icon = va[1];
if(IsNull(icon))
icon = IdeImg::Package();
else
icon = DPI(icon, 16);
w.DrawRect(r, paper);
w.DrawImage(r.left, r.top + (r.Height() - icon.GetHeight()) / 2, icon);
w.DrawText(r.left + Zx(20), r.top + (r.Height() - Draw::GetStdFontCy()) / 2, txt, fnt, ink);
}
示例15: Apply
static void Apply( GenericImage<P>& image, const FFTConvolution& F )
{
Rect r = image.SelectedRectangle();
if ( F.m_h.IsNull() )
if ( !F.m_filter.IsNull() )
F.m_h = Initialize( *F.m_filter, r.Width(), r.Height(), F.IsParallelProcessingEnabled(), F.MaxProcessors() );
else
F.m_h = Initialize( F.m_image, r.Width(), r.Height(), F.IsParallelProcessingEnabled(), F.MaxProcessors() );
Convolve( image, *F.m_h, F.IsParallelProcessingEnabled(), F.MaxProcessors() );
}