• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Draw a triangle with background color

lbj60

Lurker
I did this, how can i color the background of it though?>


[HIGH]Bitmap canvasBitmap = Bitmap.createBitmap( width, height, Bitmap.Config.ARGB_8888); BitmapShader shader = new BitmapShader(canvasBitmap, TileMode.CLAMP, TileMode.CLAMP); Canvas canvas = new Canvas(canvasBitmap); Paint paint = new Paint(); //paint.setStyle(Paint.Style.FILL); paint.setStrokeWidth(3); paint.setColor(Color.parseColor("#52c1b1")); canvas.drawLine(0, 0 , width, 0 , paint); canvas.drawLine(0, 0 , width/2, width/2 , paint); canvas.drawLine(width, 0 , width/2, width/2 , paint); return canvasBitmap;[/HIGH]
 
Back
Top Bottom