TheRealMatze Active Member Licensed User Mar 9, 2021 #1 Hi, i found "DrawDrawable" for a gradient in the manuals for canvas, but this works not for b4xcanvas. Is it possible to fill a drawRect with a gradient in b4xcanvas? Regards Matze
Hi, i found "DrawDrawable" for a gradient in the manuals for canvas, but this works not for b4xcanvas. Is it possible to fill a drawRect with a gradient in b4xcanvas? Regards Matze
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2021 #2 If you need a cross platform solution then use BitmapCreator to create the gradient and draw it with Canvas.DrawBitmap. If it is a B4A only solution then you can get the original Canvas and use DrawDrawable: https://www.b4x.com/android/forum/threads/b4xcanvas-getcanvas.98799/post-622296 Upvote 0
If you need a cross platform solution then use BitmapCreator to create the gradient and draw it with Canvas.DrawBitmap. If it is a B4A only solution then you can get the original Canvas and use DrawDrawable: https://www.b4x.com/android/forum/threads/b4xcanvas-getcanvas.98799/post-622296
TheRealMatze Active Member Licensed User Mar 9, 2021 #3 Hi! Is there a example for cross-platform, i dont find anything... Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2021 #4 See Klaus example: https://www.b4x.com/android/forum/threads/gradients-and-circles-ovals.105636/post-661566 And my following examples as well. Note that you should reuse the BitmapCreator when possible. Upvote 0
See Klaus example: https://www.b4x.com/android/forum/threads/gradients-and-circles-ovals.105636/post-661566 And my following examples as well. Note that you should reuse the BitmapCreator when possible.
klaus Expert Licensed User Longtime User Mar 9, 2021 #5 You find an example of drawing a round corner rectangle with four gradient colors in the B4X Graphics booklet. Upvote 0
You find an example of drawing a round corner rectangle with four gradient colors in the B4X Graphics booklet.