本文整理汇总了C++中Control::BoundsRect方法的典型用法代码示例。如果您正苦于以下问题:C++ Control::BoundsRect方法的具体用法?C++ Control::BoundsRect怎么用?C++ Control::BoundsRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::BoundsRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __ColorSample_Paint
void AnnotationInterface::__ColorSample_Paint( Control& sender, const Rect& /*updateRect*/ )
{
Graphics g( sender );
g.SetBrush( instance.annotationColor );
g.SetPen( RGBAColor( 0, 0, 0 ) );
g.DrawRect( sender.BoundsRect() );
}
示例2: __ColorSample_Paint
void BinarizeInterface::__ColorSample_Paint( Control& sender, const Rect& /*updateRect*/ )
{
Graphics g( sender );
g.SetBrush( RGBAColor( float( instance.level[0] ), float( instance.level[1] ), float( instance.level[2] ) ) );
g.SetPen( 0xff000000, sender.DisplayPixelRatio() );
g.DrawRect( sender.BoundsRect() );
}
示例3: __ColorSample_Paint
void NewImageInterface::__ColorSample_Paint( Control& sender, const Rect& /*updateRect*/ )
{
Graphics g( sender );
RGBA rgba = RGBAColor( float( instance.v0 ), float( instance.v1 ), float( instance.v2 ) );
if ( HASALPHA )
{
g.SetBrush( Bitmap( ":/image-window/transparent-small.png" ) );
g.SetPen( Pen::Null() );
g.DrawRect( sender.BoundsRect() );
SetAlpha( rgba, RoundI( 255*instance.va ) );
}
g.SetBrush( rgba );
g.SetPen( RGBAColor( 0, 0, 0 ) );
g.DrawRect( sender.BoundsRect() );
}
示例4: SkyChart_Paint
void INDIMountInterface::SkyChart_Paint( Control& sender, const Rect& updateRect )
{
Graphics g( sender );
RGBA darkRed = RGBAColor( 153, 0, 0 );
RGBA darkYellow = RGBAColor( 153, 153, 0 );
RGBA darkGreen = RGBAColor( 0, 153, 0 );
Rect r( sender.BoundsRect() );
int w = r.Width();
int h = r.Height();
int x0 = w >> 1;
int y0 = h >> 1;
g.FillRect( r, 0u );
g.SetBrush( Brush::Null() );
g.SetPen( darkRed );
const int margin = 10;
g.DrawLine( x0, 0+margin, x0, h-margin );
g.DrawLine( 0+margin, y0, w-margin, y0 );
g.EnableAntialiasing();
if ( m_isAllSkyView )
{
double chartRadius = x0 - margin;
g.DrawCircle( x0, y0, chartRadius );
// draw telescope position
StereoProjection::Spherical s;
double hourAngle = (m_TargetRA.ToDouble() - m_lst)*360/24;
double currentAlt = SkyMap::getObjectAltitude( m_TargetDEC.ToDouble(), hourAngle, m_geoLat );
double currentAz = SkyMap::getObjectAzimut( m_TargetDEC.ToDouble(), hourAngle, m_geoLat );
s.phi = Rad( currentAz );
s.theta = Rad( 90 + currentAlt );
StereoProjection::Polar p = s.Projected( chartRadius );
StereoProjection::Rectangular r = p.ToRectangular();
#if 0
Console().WriteLn( String().Format( "x=%f, y=%f, r=%f", r.x, r.y, chartRadius ) );
Console().WriteLn( String().Format( "x0=%d, y0=%d", x0, y0 ) );
Console().WriteLn( String().Format( "w=%d, h=%d", w, h ) );
Console().WriteLn( String().Format( "phi=%f, theta=%f", s.phi, s.theta ) );
Console().WriteLn( String().Format( "r=%f, pphi=%f", p.r, p.phi ) );
#endif
g.DrawCircle( x0+r.x, y0+r.y, 5 );
g.SetPen( darkGreen );
hourAngle = (m_scopeRA - m_lst)*360/24;
currentAlt = SkyMap::getObjectAltitude( m_scopeDEC, hourAngle, m_geoLat );
currentAz = SkyMap::getObjectAzimut( m_scopeDEC, hourAngle, m_geoLat );
s.phi = Rad( currentAz );
s.theta = Rad( 90 + currentAlt );
r = s.Projected( chartRadius ).ToRectangular();
g.DrawCircle( x0+r.x, y0+r.y, 5 );
g.SetPen( darkYellow );
if ( m_skymap != nullptr )
m_skymap->plotStars( m_lst, m_geoLat, x0, y0, chartRadius, g, m_limitStarMag );
}
else
{
if ( m_skymap != nullptr )
{
double CCD_chipHeight = 2200;
double CCD_chipWidth = 2750;
double CCD_pixelSize = 4.54/1000;
double TEL_focalLength = 700;
double FoV_width = CCD_chipWidth*CCD_pixelSize / TEL_focalLength*3438/60;
double FoV_height = CCD_chipHeight*CCD_pixelSize / TEL_focalLength*3438/60;
double scale = 180.0/FoV_width;
// draw scope position
double currentAlt = SkyMap::getObjectAltitude( m_scopeDEC, m_scopeRA*360/24, m_geoLat );
double currentAz = SkyMap::getObjectAzimut( m_scopeDEC, m_scopeRA*360/24, m_geoLat );
StereoProjection::Spherical spherical( Rad( currentAz ), Rad( 90 + currentAlt ) );
StereoProjection::Polar p = spherical.Projected( scale*x0 );
StereoProjection::Rectangular r = p.ToRectangular();
//Console().WriteLn( String().Format( "xx=%f, yy=%f, r=%f", r.x, r.y, scale * x0 ) );
g.DrawCircle( x0, y0, 5 );
// draw alignment deviation
double alignAlt = SkyMap::getObjectAltitude( m_alignedDEC, m_alignedRA*360/24, m_geoLat );
double alignAz = SkyMap::getObjectAzimut( m_alignedDEC, m_alignedRA*360/24, m_geoLat );
StereoProjection::Rectangular rAlign =
StereoProjection::Spherical( Rad( alignAz ), Rad( 90 + alignAlt ) ).Projected( scale*x0 ).ToRectangular();
g.SetPen( darkGreen );
g.DrawLine( x0 - r.x + r.x,
y0 - r.y + r.y,
x0 - r.x + rAlign.x,
y0 - r.y + rAlign.y );
m_skymap->plotFoVStars( m_lst, m_geoLat, x0-r.x, y0-r.y, scale*x0, g, 13 );
}
}
}