呼吸

        double fRate = (double)(GetTickCount() - m_dwShineStartTime) / (double)(350);

        if (m_bFadeType)
        {
            //渐隐
            if (fRate < 1)
            {
                 fRate = 1.0 - fRate;
            }
            else
            {
                m_bFadeType = FALSE;
                fRate = 0;
                m_dwShineStartTime = GetTickCount();
            } 
        }
        else
        {
            //渐显
            if (fRate > 1)
            {
                m_bFadeType = TRUE;
                fRate = 1;
                m_dwShineStartTime = GetTickCount();
            }
            fRate = pow(fRate, 2);
        }

    }

你可能感兴趣的:(呼吸)