毕业论文

打赏
当前位置: 毕业论文 > 计算机论文 >

Android平台手机图片浏览软件的开发实现(16)

时间:2017-01-09 12:55来源:毕业论文
// Create the bitmap which contains original and reflection bitmap. Bitmap bitmapWithReflection = Bitmap.createBitmap( reflectionWidth, srcHeight + reflectionHeight + REFLECTION_GAP, Config.ARGB_8888)


            // Create the bitmap which contains original and reflection bitmap.
            Bitmap bitmapWithReflection = Bitmap.createBitmap(
                    reflectionWidth,
                    srcHeight + reflectionHeight + REFLECTION_GAP,
                    Config.ARGB_8888);            
            if (null == bitmapWithReflection)
                     return null;                      
            // Prepare the canvas to draw stuff.
            Canvas canvas = new Canvas(bitmapWithReflection);            
            // Draw the original bitmap.
            canvas.drawBitmap(srcBitmap, 0, 0, null);            
            // Draw the reflection bitmap.
            canvas.drawBitmap(reflectionBitmap, 0, srcHeight + REFLECTION_GAP, null);            
            Paint paint = new Paint();
            paint.setAntiAlias(true);
            LinearGradient shader = new LinearGradient(
                    0,
                    srcHeight,
                    0,
                    bitmapWithReflection.getHeight() + REFLECTION_GAP,
                    0x70FFFFFF,
                    0x00FFFFFF,
                    TileMode.MIRROR);
            paint.setShader(shader);
            paint.setXfermode(new PorterDuffXfermode(android.graphics.PorterDuff.Mode.DST_IN));
            
            // Draw the linear shader.
            canvas.drawRect(
                    0,
                    srcHeight, Android平台手机图片浏览软件的开发实现(16):http://www.751com.cn/jisuanji/lunwen_2019.html
------分隔线----------------------------
推荐内容