コード例 #1
0
 public void Initialize(Color oSolidColor, int iMinAlpha, int iMaxAlpha, int iAlphaIncrementPerLevel)
 {
     if (oSolidColor.A != 255)
     {
         throw new ArgumentOutOfRangeException("oSolidColor", oSolidColor, "TransparentBrushMapper.Initialize(): oSolidColor must not be transparent.");
     }
     TransparentBrushMapper.ValidateAlphaRange(iMinAlpha, iMaxAlpha, iAlphaIncrementPerLevel, "TransparentBrushMapper.Initialize()");
     this.m_oTransparentBrushes = new ArrayList();
     for (int i = iMinAlpha; i <= iMaxAlpha; i += iAlphaIncrementPerLevel)
     {
         Color color = Color.FromArgb(i, oSolidColor);
         Brush brush = new SolidBrush(color);
         this.m_oTransparentBrushes.Add(brush);
     }
     this.m_iTransparentBrushes = this.m_oTransparentBrushes.Count;
     this.AssertValid();
 }