本文整理汇总了C#中System.Drawing.Drawing2D.Matrix.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix.Clone方法的具体用法?C# Matrix.Clone怎么用?C# Matrix.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Drawing2D.Matrix
的用法示例。
在下文中一共展示了Matrix.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeTransformMatrix
protected virtual bool InitializeTransformMatrix()
{
using (MethodLogger ml = new MethodLogger(this))
{
if (!CheckGraphSanity()) { return false; }
if (this.StartIndex == this.EndIndex || this.EndIndex > this.dateSerie.Length - 1)
{
this.IsInitialized = false;
InvalidSerieException e = new InvalidSerieException("Invalid input data range...");
StockLog.Write(e);
throw e;
}
if (this.GraphRectangle.Height > 0)
{
minValue = float.MaxValue;
maxValue = float.MinValue;
this.CurveList.GetMinMax(StartIndex, EndIndex, ref minValue, ref maxValue, this.ScaleInvisible);
if (minValue == maxValue || minValue == float.MaxValue || float.IsNaN(minValue) || float.IsInfinity(minValue) || maxValue == float.MinValue || float.IsNaN(maxValue) || float.IsInfinity(maxValue))
{
this.Deactivate("Input data is corrupted and cannot be displayed...", false);
return false;
}
if (this.IsLogScale && minValue > 0)
{
minValue *= 0.95f;
}
else
{
minValue -= (maxValue - minValue) * 0.1f;
}
maxValue += (maxValue - minValue) * 0.1f;
float tmpMinValue, tmpMaxValue;
if (this.IsLogScale)
{
tmpMinValue = minValue < 0 ? (float)-Math.Log10(-minValue + 1) : (float)Math.Log10(minValue + 1);
tmpMaxValue = maxValue < 0 ? (float)-Math.Log10(-maxValue + 1) : (float)Math.Log10(maxValue + 1);
}
else
{
tmpMinValue = minValue;
tmpMaxValue = maxValue;
}
float coefX = (this.GraphRectangle.Width * 0.96f) / (EndIndex - StartIndex);
float coefY = this.GraphRectangle.Height / (tmpMaxValue - tmpMinValue);
matrixValueToScreen = new System.Drawing.Drawing2D.Matrix();
matrixValueToScreen.Translate(this.GraphRectangle.X - (StartIndex - 0.5f) * coefX, tmpMaxValue * coefY + this.GraphRectangle.Y);
matrixValueToScreen.Scale(coefX, -coefY);
matrixScreenToValue = (System.Drawing.Drawing2D.Matrix)matrixValueToScreen.Clone();
matrixScreenToValue.Invert();
}
else
{
this.Deactivate("App too small...", false);
return false;
}
return true;
}
}