C# 如何缩放混合的比例因子和位置

C# 如何缩放混合的比例因子和位置,c#,winforms,visual-studio-2008,C#,Winforms,Visual Studio 2008,我在这个问题上纠缠了几个小时,但似乎没有取得进展 我有一个完美的环(图1),但当我增加内椭圆时,我就失去了图纸(图2) 我想我需要缩放Blend.Factor和/或Blend.Positions,但我不知道该怎么做 这是我的因子和位置数组: _Factors = new float[] { 0f, 1f, 0f, 0f }; _Positions = new float[] { 0f, 0.25f, 0.5f, 1f }; 这是我的绘画功能: using (Brush oInnerBr

我在这个问题上纠缠了几个小时,但似乎没有取得进展

我有一个完美的环(图1),但当我增加内椭圆时,我就失去了图纸(图2)

我想我需要缩放Blend.Factor和/或Blend.Positions,但我不知道该怎么做

这是我的因子和位置数组:

_Factors = new float[] { 0f, 1f, 0f, 0f };
_Positions = new float[] { 0f, 0.25f, 0.5f, 1f };
这是我的绘画功能:

   using (Brush oInnerBrush = new SolidBrush(_InnerColor))
     {
        using (Pen oBaseBrush = new Pen(_BaseColor, 2))
        {
           using (GraphicsPath oGraphPath = new GraphicsPath())
           {
              // Outside
              oGraphPath.AddEllipse(oRect);

              // Inside
              oGraphPath.AddEllipse(oRect.Shrink(_InnerWidth));

              using (PathGradientBrush oGradBrush = new PathGradientBrush(oGraphPath))
              {
                 Blend oBlend = new Blend();
                 oBlend.Factors = _Factors;
                 oBlend.Positions = _Positions;
                 oGradBrush.Blend = oBlend;

                 oGradBrush.CenterColor = ((SolidBrush)oInnerBrush).Color;
                 oGradBrush.SurroundColors = new Color[] { oBaseBrush.Color };

                 Area.FillPath(oGradBrush, oGraphPath);
              }
           }
        }
      }
有什么想法吗?多谢各位

编辑:我正在使用中的代码