本文整理匯總了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;
}
}
}