<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                光暈特效在于凸顯一個光圈: 下面是效果圖 ![](https://box.kancloud.cn/2016-03-28_56f8ea7b4bd86.jpg) ~~~ ?/**? ? ? ?* 光暈效果? ? ? ?* @param bmp? ? ? ?* @param x 光暈中心點在bmp中的x坐標? ? ? ?* @param y 光暈中心點在bmp中的y坐標? ? ? ?* @param r 光暈的半徑? ? ? ?* @return? ? ? ?*/ ? ? ? public static Bitmap halo(Bitmap bmp, int x, int y, float r) ? ? ? { ? ? ? ? ? long start = System.currentTimeMillis(); ? ? ? ? ? // 高斯矩陣 ? ? ? ? ? int[] gauss = new int[] { 1, 2, 1, 2, 4, 2, 1, 2, 1 }; ? ? ? ? ? ?? ? ? ? ? int width = bmp.getWidth(); ? ? ? ? ? int height = bmp.getHeight(); ? ? ? ? ? Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); ? ? ? ? ? ?? ? ? ? ? int pixR = 0; ? ? ? ? ? int pixG = 0; ? ? ? ? ? int pixB = 0; ? ? ? ? ? ?? ? ? ? ? int pixColor = 0; ? ? ? ? ? ?? ? ? ? ? int newR = 0; ? ? ? ? ? int newG = 0; ? ? ? ? ? int newB = 0; ? ? ? ? ? ?? ? ? ? ? int delta = 18; // 值越小圖片會越亮,越大則越暗 ? ? ? ? ? ?? ? ? ? ? int idx = 0; ? ? ? ? ? int[] pixels = new int[width * height]; ? ? ? ? ? bmp.getPixels(pixels, 0, width, 0, 0, width, height); ? ? ? ? ? for (int i = 1, length = height - 1; i < length; i++) ? ? ? ? ? { ? ? ? ? ? ? ? for (int k = 1, len = width - 1; k < len; k++) ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? idx = 0; ? ? ? ? ? ? ? ? ? int distance = (int) (Math.pow(k - x, 2) + Math.pow(i - y, 2)); ? ? ? ? ? ? ? ? ? // 不是中心區域的點做模糊處理 ? ? ? ? ? ? ? ? ? if (distance > r * r) ? ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? for (int m = -1; m <= 1; m++) ? ? ? ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? for (int n = -1; n <= 1; n++) ? ? ? ? ? ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pixColor = pixels[(i + m) * width + k + n]; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pixR = Color.red(pixColor); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pixG = Color.green(pixColor); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? pixB = Color.blue(pixColor); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? newR = newR + (int) (pixR * gauss[idx]); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? newG = newG + (int) (pixG * gauss[idx]); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? newB = newB + (int) (pixB * gauss[idx]); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? idx++; ? ? ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? newR /= delta; ? ? ? ? ? ? ? ? ? ? ? newG /= delta; ? ? ? ? ? ? ? ? ? ? ? newB /= delta; ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? newR = Math.min(255, Math.max(0, newR)); ? ? ? ? ? ? ? ? ? ? ? newG = Math.min(255, Math.max(0, newG)); ? ? ? ? ? ? ? ? ? ? ? newB = Math.min(255, Math.max(0, newB)); ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? pixels[i * width + k] = Color.argb(255, newR, newG, newB); ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? newR = 0; ? ? ? ? ? ? ? ? ? ? ? newG = 0; ? ? ? ? ? ? ? ? ? ? ? newB = 0; ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? } ? ? ? ? ? } ? ? ? ? ? ?? ? ? ? ? bitmap.setPixels(pixels, 0, width, 0, 0, width, height); ? ? ? ? ? long end = System.currentTimeMillis(); ? ? ? ? ? Log.d("may", "used time="+(end - start)); ? ? ? ? ? return bitmap; ? ? ? } ? ~~~ 如上所說我們需要對圓做設置:1.圓心的XY。2.圓的半徑。 有了這些設定,我們就可以確定圓圈的范圍,對園內和圓外做不同的操作,這里我讓圓內保持不變,圓外改變 這樣就完成了,當然大家可以針對園內做成亮色,把離圓心近的地方做更深程度的亮色,這樣就有光線的感覺了
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看