the problem afaik is that the bitmap used in the canvas is argb_4444 which has quite a shallow pool of colours to choose from and to get a decent gradient you need argb_8888 or a decent amount of dithering - neither of which i'm achieving
best a On 14 February 2011 23:13, Mark <[email protected]> wrote: > I am also experiencing this issue. The code I am using to apply a gradient > is as follows... > > Canvas DestinationCanvas = new Canvas(); > DestinationCanvas.setBitmap(DestinationBitmap); > //Gradient is going from very transparent black to fully black at the > bottom > GradientDrawable grad = new GradientDrawable(Orientation.TOP_BOTTOM, new > int[]{0x02000000, 0x2a000000, 0x5b000000, 0x90000000, 0xc9000000, > 0xcc000000}); > grad.setBounds(0, 0, DestinationBitmap.getWidth(), RequiredHeight); > grad.draw(DestinationCanvas); > > > Calling grad.setDither(true) or setFilter(true) does not help. > > Regards, > Mark England > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

