rraswisak Active Member Licensed User Longtime User Jul 21, 2020 #1 Hi I want to make gradient color with B4XCanvas, it is possible when using DrawDrawable method with canvas. By using B4XCanvas, the method is not in the list, is there any reason why the method missing ? Thank you
Hi I want to make gradient color with B4XCanvas, it is possible when using DrawDrawable method with canvas. By using B4XCanvas, the method is not in the list, is there any reason why the method missing ? Thank you
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2020 #2 rraswisak said: is there any reason why the method missing ? Click to expand... Drawable is an Android only concept. The cross platform way to create gradients is with BitmapCreator. You can use it together with B4XCanvas. Check this example: https://www.b4x.com/android/forum/threads/b4xcanvas-rounded-square-corners.103795/#content If you do need B4XCanvas then create a bitmap from the gradient BC and draw it with B4XCanvas.DrawBitmap. Upvote 0
rraswisak said: is there any reason why the method missing ? Click to expand... Drawable is an Android only concept. The cross platform way to create gradients is with BitmapCreator. You can use it together with B4XCanvas. Check this example: https://www.b4x.com/android/forum/threads/b4xcanvas-rounded-square-corners.103795/#content If you do need B4XCanvas then create a bitmap from the gradient BC and draw it with B4XCanvas.DrawBitmap.
rraswisak Active Member Licensed User Longtime User Jul 21, 2020 #3 Thank you Erel, i'm get it now. The link you provided just solve my current issue. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 21, 2020 #4 Tip: don't create a new gradient brush each time, if you are making multiple drawings. Upvote 0