本文整理汇总了C#中IGraphics.ResetClip方法的典型用法代码示例。如果您正苦于以下问题:C# IGraphics.ResetClip方法的具体用法?C# IGraphics.ResetClip怎么用?C# IGraphics.ResetClip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraphics
的用法示例。
在下文中一共展示了IGraphics.ResetClip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPaint
public override void OnPaint(IGraphics g, int width, int height)
{
if (widths == null){
InitSizes(width, height);
}
PaintSplitters(g, width, height);
for (int row = 0; row < RowCount; row++){
for (int col = 0; col < ColumnCount; col++){
Tuple<int, int> key = new Tuple<int, int>(row, col);
if (components.ContainsKey(key)){
BasicView v = components[key];
g.SetClip(new Rectangle2(xpos[col], ypos[row], widths[col], heights[row]));
g.TranslateTransform(xpos[col], ypos[row]);
v.OnPaint(g, widths[col], heights[row]);
g.ResetTransform();
g.ResetClip();
}
}
}
}
示例2: Draw
//.........这里部分代码省略.........
if ( _chart._rect.Width < 1 || _chart._rect.Height < 1 )
return;
// Draw the graph features only if there is at least one curve with data
// if ( _curveList.HasData() &&
// Go ahead and draw the graph, even without data. This makes the control
// version still look like a graph before it is fully set up
bool showGraf = AxisRangesValid();
// Setup the axes for graphing - This setup must be done before
// the GraphObj's are drawn so that the Transform functions are
// ready. Also, this should be done before CalcChartRect so that the
// Axis.Cross - shift parameter can be calculated.
_xAxis.Scale.SetupScaleData( this, _xAxis );
_x2Axis.Scale.SetupScaleData( this, _x2Axis );
foreach ( Axis axis in _yAxisList )
axis.Scale.SetupScaleData( this, axis );
foreach ( Axis axis in _y2AxisList )
axis.Scale.SetupScaleData( this, axis );
// Draw the GraphItems that are behind the Axis objects
if ( showGraf )
_graphObjList.Draw( g, this, scaleFactor, ZOrder.G_BehindChartFill );
// Fill the axis background
_chart.Fill.Draw( g, _chart._rect );
if ( showGraf )
{
// Draw the GraphItems that are behind the CurveItems
_graphObjList.Draw( g, this, scaleFactor, ZOrder.F_BehindGrid );
DrawGrid( g, scaleFactor );
// Draw the GraphItems that are behind the CurveItems
_graphObjList.Draw( g, this, scaleFactor, ZOrder.E_BehindCurves );
// Clip the points to the actual plot area
g.SetClip( _chart._rect );
_curveList.Draw( g, this, scaleFactor );
g.SetClip( _rect );
}
if ( showGraf )
{
// Draw the GraphItems that are behind the Axis objects
_graphObjList.Draw( g, this, scaleFactor, ZOrder.D_BehindAxis );
// Draw the Axes
_xAxis.Draw( g, this, scaleFactor, 0.0f );
_x2Axis.Draw( g, this, scaleFactor, 0.0f );
float yPos = 0;
foreach ( Axis axis in _yAxisList )
{
axis.Draw( g, this, scaleFactor, yPos );
yPos += axis._tmpSpace;
}
yPos = 0;
foreach ( Axis axis in _y2AxisList )
{
axis.Draw( g, this, scaleFactor, yPos );
yPos += axis._tmpSpace;
}
// Draw the GraphItems that are behind the Axis border
_graphObjList.Draw( g, this, scaleFactor, ZOrder.C_BehindChartBorder );
}
// Border the axis itself
_chart.Border.Draw( g, this, scaleFactor, _chart._rect );
if ( showGraf )
{
// Draw the GraphItems that are behind the Legend object
_graphObjList.Draw( g, this, scaleFactor, ZOrder.B_BehindLegend );
_legend.Draw( g, this, scaleFactor );
// Draw the GraphItems that are in front of all other items
_graphObjList.Draw( g, this, scaleFactor, ZOrder.A_InFront );
}
// Reset the clipping
g.ResetClip();
// Reset scale data
// this sets the temp values to NaN to cause an exception if these values are
// being used improperly
// Don't do this, since the web control needs access
/*
_xAxis.Scale.ResetScaleData();
foreach ( Axis axis in _yAxisList )
axis.Scale.ResetScaleData();
foreach ( Axis axis in _y2AxisList )
axis.Scale.ResetScaleData();
*/
}
示例3: Draw
/// <summary>
/// Render all the <see cref="GraphPane"/> objects in the <see cref="PaneList"/> to the
/// specified graphics device.
/// </summary>
/// <remarks>This method should be part of the Paint() update process. Calling this routine
/// will redraw all
/// features of all the <see cref="GraphPane"/> items. No preparation is required other than
/// instantiated <see cref="GraphPane"/> objects that have been added to the list with the
/// <see cref="Add"/> method.
/// </remarks>
/// <param name="g">
/// A graphic device object to be drawn into. This is normally e.Graphics from the
/// PaintEventArgs argument to the Paint() method.
/// </param>
public override void Draw(IGraphics g)
{
// Save current AntiAlias mode
SmoothingMode sModeSave = g.SmoothingMode;
TextRenderingHint sHintSave = g.TextRenderingHint;
CompositingQuality sCompQual = g.CompositingQuality;
InterpolationMode sInterpMode = g.InterpolationMode;
SetAntiAliasMode(g, isAntiAlias);
// Draw the pane border & background fill, the title, and the GraphObj objects that lie at
// ZOrder.GBehindAll
base.Draw(g);
if (_rect.Width <= 1 || _rect.Height <= 1)
{
return;
}
float scaleFactor = CalcScaleFactor();
// Clip everything to the rect
g.SetClip(_rect);
// For the MasterPane, All GraphItems go behind the GraphPanes, except those that
// are explicity declared as ZOrder.AInFront
_graphObjList.Draw(g, this, scaleFactor, ZOrder.G_BehindChartFill);
_graphObjList.Draw(g, this, scaleFactor, ZOrder.E_BehindCurves);
_graphObjList.Draw(g, this, scaleFactor, ZOrder.D_BehindAxis);
_graphObjList.Draw(g, this, scaleFactor, ZOrder.C_BehindChartBorder);
// Reset the clipping
g.ResetClip();
foreach (GraphPane pane in _paneList)
{
pane.Draw(g);
}
// Clip everything to the rect
g.SetClip(_rect);
_graphObjList.Draw(g, this, scaleFactor, ZOrder.B_BehindLegend);
// Recalculate the legend rect, just in case it has not yet been done
// innerRect is the area for the GraphPane's
RectangleF innerRect = CalcClientRect(g, scaleFactor);
_legend.CalcRect(g, this, scaleFactor, ref innerRect);
//this.legend.SetLocation( this,
_legend.Draw(g, this, scaleFactor);
_graphObjList.Draw(g, this, scaleFactor, ZOrder.A_InFront);
// Reset the clipping
g.ResetClip();
// Restore original anti-alias mode
g.SmoothingMode = sModeSave;
g.TextRenderingHint = sHintSave;
g.CompositingQuality = sCompQual;
g.InterpolationMode = sInterpMode;
}
示例4: Draw
/// <summary>
/// Do all rendering associated with this <see cref="PaneBase"/> to the specified
/// <see cref="Graphics"/> device. This abstract method is implemented by the child
/// classes.
/// </summary>
/// <param name="g">
/// A graphic device object to be drawn into. This is normally e.Graphics from the
/// PaintEventArgs argument to the Paint() method.
/// </param>
public virtual void Draw( IGraphics g )
{
if ( _rect.Width <= 1 || _rect.Height <= 1 )
return;
// calculate scaleFactor on "normal" pane size (BaseDimension)
float scaleFactor = CalcScaleFactor();
// Fill the pane background and draw a border around it
DrawPaneFrame( g, scaleFactor );
// Clip everything to the rect
g.SetClip( _rect );
// Draw the GraphItems that are behind everything
_graphObjList.Draw( g, this, scaleFactor, ZOrder.H_BehindAll );
// Draw the Pane Title
DrawTitle( g, scaleFactor );
// Draw the Legend
//this.Legend.Draw( g, this, scaleFactor );
// Reset the clipping
g.ResetClip();
}