¡@

Home 

2014/10/16 ¤W¤È 08:17:54

android Programming Glossary: lineargradient

Fill color on bitmap in android

http://stackoverflow.com/questions/20697189/fill-color-on-bitmap-in-android

Canvas canvas new Canvas bmResult paint.setShader new LinearGradient widthToFill 75 widthToFill 75 0xFF97ca3e 0xFF284060 TileMode.MIRROR.. 0xFF97ca3e 0xFF284060 TileMode.MIRROR paint.setShader new LinearGradient widthToFill 75 widthToFill 75 0xFF97ca3e 0xFF284060 TileMode.CLAMP..

Trying to draw a button: how to set a stroke color and how to “align” a gradient to the bottom without knowing the height?

http://stackoverflow.com/questions/2145131/trying-to-draw-a-button-how-to-set-a-stroke-color-and-how-to-align-a-gradient

to the bottom of the button. final Shader shader new LinearGradient 0 0 0 30 new int color_1 color_2 null Shader.TileMode.MIRROR..

Text with gradient in Android

http://stackoverflow.com/questions/2680607/text-with-gradient-in-android

secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE new float 0 1 TileMode.CLAMP..

How to fill a Path in Android with a linear gradient?

http://stackoverflow.com/questions/2836098/how-to-fill-a-path-in-android-with-a-linear-gradient

gradient the full height of the screen. p.setShader new LinearGradient 0 0 0 getHeight Color.BLACK Color.WHITE Shader.TileMode.MIRROR..

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

@Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int Color.GREEN Color.GREEN.. Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int Color.GREEN Color.GREEN Color.WHITE.. @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 0 theButton.getHeight new int Color.LIGHT_GREEN..

Gradients and shadows on buttons

http://stackoverflow.com/questions/4891711/gradients-and-shadows-on-buttons

Canvas bmResult Paint paint new Paint paint.setShader new LinearGradient 0 0 0 bmResult.getHeight 2 0xFF284560 0xFF284060 TileMode.MIRROR.. TileMode.MIRROR canvas.drawPaint paint paint.setShader new LinearGradient 0 0 0 bmResult.getHeight 2 0x55FFFFFF 0x22FFFFFF TileMode.CLAMP..

Changing gradient background colors on Android at runtime

http://stackoverflow.com/questions/4941606/changing-gradient-background-colors-on-android-at-runtime

new RectShape mDrawable.getPaint .setShader new LinearGradient 0 0 0 h Color.parseColor #330000FF Color.parseColor #110000FF..

Android: Shader behave different in 'onDraw(canvas)' and 'new Canvas(bitmap)'

http://stackoverflow.com/questions/5231260/android-shader-behave-different-in-ondrawcanvas-and-new-canvasbitmap

source matrix new Paint Paint paint2 new Paint LinearGradient shader new LinearGradient source.getWidth 3 2 source.getHeight.. new Paint Paint paint2 new Paint LinearGradient shader new LinearGradient source.getWidth 3 2 source.getHeight source.getWidth 3 2 source.getHeight.. source matrix new Paint paint2 new Paint shader new LinearGradient source.getWidth 1 2 source.getHeight source.getWidth 1 2 source.getHeight..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP..

Carousel library for android

http://stackoverflow.com/questions/9838518/carousel-library-for-android

import android.graphics.LinearGradient import android.graphics.Matrix import android.graphics.Paint.. reflectionGap null final Paint paint new Paint final LinearGradient shader new LinearGradient 0 sepia.getHeight 0 bitmapWithReflection.getHeight.. Paint paint new Paint final LinearGradient shader new LinearGradient 0 sepia.getHeight 0 bitmapWithReflection.getHeight reflectionGap..

Fill color on bitmap in android

http://stackoverflow.com/questions/20697189/fill-color-on-bitmap-in-android

Bitmap.createBitmap barWidth 75 Bitmap.Config.ARGB_8888 Canvas canvas new Canvas bmResult paint.setShader new LinearGradient widthToFill 75 widthToFill 75 0xFF97ca3e 0xFF284060 TileMode.MIRROR paint.setShader new LinearGradient widthToFill 75 widthToFill.. new LinearGradient widthToFill 75 widthToFill 75 0xFF97ca3e 0xFF284060 TileMode.MIRROR paint.setShader new LinearGradient widthToFill 75 widthToFill 75 0xFF97ca3e 0xFF284060 TileMode.CLAMP paint.setARGB 188 164 120 130 canvas.drawRect 0 0 widthToFill..

Trying to draw a button: how to set a stroke color and how to “align” a gradient to the bottom without knowing the height?

http://stackoverflow.com/questions/2145131/trying-to-draw-a-button-how-to-set-a-stroke-color-and-how-to-align-a-gradient

the height beforehand . I wish I could set the gradient aligned to the bottom of the button. final Shader shader new LinearGradient 0 0 0 30 new int color_1 color_2 null Shader.TileMode.MIRROR float roundedCorner new float 5 5 5 5 5 5 5 5 ShapeDrawable..

Text with gradient in Android

http://stackoverflow.com/questions/2680607/text-with-gradient-in-android

android user interface share improve this question TextView secondTextView new TextView this Shader textShader new LinearGradient 0 0 0 20 new int Color.GREEN Color.BLUE new float 0 1 TileMode.CLAMP secondTextView.getPaint .setShader textShader share..

How to fill a Path in Android with a linear gradient?

http://stackoverflow.com/questions/2836098/how-to-fill-a-path-in-android-with-a-linear-gradient

Multi-gradient shapes

http://stackoverflow.com/questions/4381033/multi-gradient-shapes

ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int Color.GREEN Color.GREEN Color.WHITE Color.WHITE new float 0 0.5f .55f 1 Shader.TileMode.REPEAT.. sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 width height new int Color.GREEN Color.GREEN Color.WHITE Color.WHITE new float 0 0.5f .55f 1 Shader.TileMode.REPEAT.. ShapeDrawable.ShaderFactory sf new ShapeDrawable.ShaderFactory @Override public Shader resize int width int height LinearGradient lg new LinearGradient 0 0 0 theButton.getHeight new int Color.LIGHT_GREEN Color.WHITE Color.MID_GREEN Color.DARK_GREEN..

Gradients and shadows on buttons

http://stackoverflow.com/questions/4891711/gradients-and-shadows-on-buttons

buttonHeight Bitmap.Config.ARGB_8888 Canvas canvas new Canvas bmResult Paint paint new Paint paint.setShader new LinearGradient 0 0 0 bmResult.getHeight 2 0xFF284560 0xFF284060 TileMode.MIRROR canvas.drawPaint paint paint.setShader new LinearGradient.. 0 0 0 bmResult.getHeight 2 0xFF284560 0xFF284060 TileMode.MIRROR canvas.drawPaint paint paint.setShader new LinearGradient 0 0 0 bmResult.getHeight 2 0x55FFFFFF 0x22FFFFFF TileMode.CLAMP paint.setMaskFilter new BlurMaskFilter 3 BlurMaskFilter.Blur.NORMAL..

Changing gradient background colors on Android at runtime

http://stackoverflow.com/questions/4941606/changing-gradient-background-colors-on-android-at-runtime

had to int h v.getHeight ShapeDrawable mDrawable new ShapeDrawable new RectShape mDrawable.getPaint .setShader new LinearGradient 0 0 0 h Color.parseColor #330000FF Color.parseColor #110000FF Shader.TileMode.REPEAT v.setBackgroundDrawable mDrawable And..

Android: Shader behave different in 'onDraw(canvas)' and 'new Canvas(bitmap)'

http://stackoverflow.com/questions/5231260/android-shader-behave-different-in-ondrawcanvas-and-new-canvasbitmap

source.getWidth source.getHeight 2 canvas.drawBitmap source matrix new Paint Paint paint2 new Paint LinearGradient shader new LinearGradient source.getWidth 3 2 source.getHeight source.getWidth 3 2 source.getHeight 2 0x7FFFFFFF 0x00FFFFFF.. source.getHeight 2 canvas.drawBitmap source matrix new Paint Paint paint2 new Paint LinearGradient shader new LinearGradient source.getWidth 3 2 source.getHeight source.getWidth 3 2 source.getHeight 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader.. 1.0f matrix.postTranslate 0 source.getHeight 2 canvas2.drawBitmap source matrix new Paint paint2 new Paint shader new LinearGradient source.getWidth 1 2 source.getHeight source.getWidth 1 2 source.getHeight 2 0x7FFFFFFF 0x00FFFFFF TileMode.CLAMP paint2.setShader..

Gradient appears banded in a SurfaceView, but looks very smooth in a normal View

http://stackoverflow.com/questions/7774867/gradient-appears-banded-in-a-surfaceview-but-looks-very-smooth-in-a-normal-view

Paint.Style.FILL paint.setAntiAlias false paint.setFilterBitmap false paint.setDither false Shader shader new LinearGradient 0 0 0 200 new int 0xff150d2f 0xff432b96 null Shader.TileMode.CLAMP paint.setShader shader canvas.drawRect 0 0 getWidth..

Carousel library for android

http://stackoverflow.com/questions/9838518/carousel-library-for-android

import android.graphics.ColorMatrix import android.graphics.ColorMatrixColorFilter import android.graphics.LinearGradient import android.graphics.Matrix import android.graphics.Paint import android.graphics.PorterDuff.Mode import android.graphics.PorterDuffXfermode.. color.transparent canvas.drawBitmap reflectionImage 0 height reflectionGap null final Paint paint new Paint final LinearGradient shader new LinearGradient 0 sepia.getHeight 0 bitmapWithReflection.getHeight reflectionGap 0x70ffffff 0x00ffffff TileMode.CLAMP.. reflectionImage 0 height reflectionGap null final Paint paint new Paint final LinearGradient shader new LinearGradient 0 sepia.getHeight 0 bitmapWithReflection.getHeight reflectionGap 0x70ffffff 0x00ffffff TileMode.CLAMP paint.setShader..