コード例 #1
0
        /////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////
        /////////////////////////////////////////////////////////////////////////////////////////


        // draw the score function  f(x,y)=ax+by+c
        static public void DrawScore(float a, float b, float c, int CAT)
        {
            Graphique G = Form1.G;

            for (int yecran = 0; yecran < G.GetH(); yecran++)
            {
                for (int xecran = 0; xecran < G.GetL(); xecran++)
                {
                    float x = G.XPixToVal(xecran);
                    float y = G.YPixToVal(yecran);

                    float score = a * x + b * y + c;

                    Color cc    = G.GetPixel(xecran, yecran);
                    float level = Utils.ColorToScore(cc);

                    if (score < level)
                    {
                        continue;
                    }

                    G.SetPixel(xecran, yecran, Utils.ScoreToColor(score, CAT));
                }
            }
        }