#region UICode
byte Amount1 = 0; // Options|All Alpha Less than| All Alpha Greater than
int Amount2 = 255; // [0,255] Alpha
ColorBgra Amount3 = ColorBgra.FromBgr(0,0,0); // Color
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
    ColorBgra CurrentPixel;
    for(int y = rect.Top; y < rect.Bottom; y++)
    {
        for (int x = rect.Left; x < rect.Right; x++)
        {
            CurrentPixel = src[x,y];
                        
            switch(Amount1)
            {
                case 1:
                        if(CurrentPixel.A<=Amount2)
                        {
                            CurrentPixel.R=(byte)(int)Amount3.R;
                            CurrentPixel.G=(byte)(int)Amount3.G;
                            CurrentPixel.B=(byte)(int)Amount3.B;
                        }
                break;
                
                case 2:
                        if(CurrentPixel.A>=Amount2)
                        {
                            CurrentPixel.R=(byte)(int)Amount3.R;
                            CurrentPixel.G=(byte)(int)Amount3.G;
                            CurrentPixel.B=(byte)(int)Amount3.B;
                        }
                break;
            }     
            dst[x,y] = CurrentPixel;
        }
    }
}
