本文整理汇总了C#中ZedGraph.MasterPane.CalcClientRect方法的典型用法代码示例。如果您正苦于以下问题:C# MasterPane.CalcClientRect方法的具体用法?C# MasterPane.CalcClientRect怎么用?C# MasterPane.CalcClientRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZedGraph.MasterPane
的用法示例。
在下文中一共展示了MasterPane.CalcClientRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoLayout
/// <summary>
/// Internal method that applies a previously set layout with a rows per column or
/// columns per row configuration. This method is only called by
/// <see cref="DoLayout(Graphics,MasterPane)" />.
/// </summary>
internal void DoLayout( Graphics g, MasterPane master, bool isColumnSpecified, int[] countList,
float[] proportion)
{
// calculate scaleFactor on "normal" pane size (BaseDimension)
float scaleFactor = master.CalcScaleFactor();
// innerRect is the area for the GraphPane's
RectangleF innerRect = master.CalcClientRect( g, scaleFactor );
master.Legend.CalcRect( g, master, scaleFactor, ref innerRect );
// scaled InnerGap is the area between the GraphPane.Rect's
float scaledInnerGap = (float)( master._innerPaneGap * scaleFactor );
int iPane = 0;
if ( isColumnSpecified )
{
int rows = countList.Length;
float y = 0.0f;
for ( int rowNum = 0; rowNum < rows; rowNum++ )
{
float propFactor = _prop == null ? 1.0f / rows : _prop[rowNum];
float height = ( innerRect.Height - (float)( rows - 1 ) * scaledInnerGap ) *
propFactor;
int columns = countList[rowNum];
if ( columns <= 0 )
columns = 1;
float width = ( innerRect.Width - (float)( columns - 1 ) * scaledInnerGap ) /
(float)columns;
if ( iPane >= master._paneList.Count )
return;
for ( int colNum = 0; colNum < columns; colNum++ )
{
master[iPane].Rect = new RectangleF(
innerRect.X + colNum * ( width + scaledInnerGap ),
innerRect.Y + y,
width,
height );
iPane++;
}
y += height + scaledInnerGap;
}
}
else
{
int columns = countList.Length;
float x = 0.0f;
for ( int colNum = 0; colNum < columns; colNum++ )
{
float propFactor = _prop == null ? 1.0f / columns : _prop[colNum];
float width = ( innerRect.Width - (float)( columns - 1 ) * scaledInnerGap ) *
propFactor;
int rows = countList[colNum];
if ( rows <= 0 )
rows = 1;
float height = ( innerRect.Height - (float)( rows - 1 ) * scaledInnerGap ) / (float)rows;
for ( int rowNum = 0; rowNum < rows; rowNum++ )
{
if ( iPane >= master._paneList.Count )
return;
master[iPane].Rect = new RectangleF(
innerRect.X + x,
innerRect.Y + rowNum * ( height + scaledInnerGap ),
width,
height );
iPane++;
}
x += width + scaledInnerGap;
}
}
}