Hi, is there a way to clip / crop with bitmapcreator ? Similar to canvas.ClipPath / canvas.RemoveClip. I would like to try using BitmapCreator instead of B4XCanvas, I'm trying to maximize performance gains.
Cross platform hexagons menu implemented as a custom view: Can show up to 7 items. B4A project is attached. Class is supported by B4J and B4i as well. Depends on XUI and BitmapCreator libraries. Example with gradient stroke: Version with gradient stroke...
BitmapCreator (BC) continues to evolve. Version 4.5 update is a large update with several new drawing features. Background At its core BC holds an array of bytes that represent an image. It can quickly extract the raw data from existing bitmaps and it can quickly generate bitmaps from this...
I tested it (BCBrush/DrawPath2), however drawing to a panel using B4XCanvas yielded 4-5x better time results than setting the panel's BG image with BC (DrawPath with BCBrush) after drawing to the bitmap initialized with BC.
100% of the code is the same except drawing so I conclude that currently, B4XCanvas draws faster than BC, at least when clipping/cropping from a path is required. However I may be wrong for some unknown reason
Thank you all, always good support, extremely appreciated.
Currently I do this 40 times :
Create a BCBrush (small square terrain image) and draw on a large bitmap according to a hexagon path...
Should I do the opposite ?
Create one transparent BCBrush, draw on each square terrain image according to an inverted path of a hexagon, then draw each bitmap on the main bitmap ?
I also realize that in this case I could use the same Path values for each terrain image instead of calculating/storing/using a path for each tile's location on the large bitmap. However the performance gain would be close to non-existant while drawing.
I think I have better ideas at work than at home. Is this good for my project ?
BitmapCreator is not faster than Canvas in all cases. In many cases it will be slower.
It is the fastest way if you want to manipulate every pixel of the image. For example if you want to change the image brightness.
It is also faster with XUI2D which is based on BitmapCreator and by drawing with BC instead of Canvas you don't need to make slow conversions.