BoundingBox has wrong values
The BoundingBox property does not return values in the coordinates of the view. My goal is to determine what barcode is closest to the center of the screen when multiple barcodes are present.
Also, note that using a Rect may not be the best idea for a BoundingBox, since the barcode can be at any angle. I think that an array of 4 points would describe it better.
@criistii He use data from Android which is property BoundingBox (left, top, right, bottom). And mapped to Microsoft.Maui.Graphics.Rect with contructor (X, Y, Width, Height). That wrong
I fix to use: obj[i].BoundingBox = new Microsoft.Maui.Graphics.Rect( obj[i].BoundingBox.X, obj[i].BoundingBox.Y, obj[i].BoundingBox.Width - obj[i].BoundingBox.X, obj[i].BoundingBox.Height - `obj[i].BoundingBox.Y);

First of all sorry for the really late response. Did not manage to get back to this issue earlier.
@tomahutbui you are right that your code correctly converts to a Maui Rectangle. Even so, I noticed that the bounding box is highly inaccurate when drawn on screen.
PS: IMO Microsoft.Maui.Graphics.Rect should not be used since the app should work on Forms as well
Anyone got a solution for this issue? Been trying to get a working solution for identifying the location of the BoundingBox property but I can't seem to get it working. Is it even possible?
@kebabmestarn I used tomahutbui's solution and it still was buggy. I ended up verifying just the Y coordinate to get an idea if the barcode is centered. Works reasonably. IMO Any rect is a bad idea to represent barcodes since they can be at an angle. Native barcodes are returned as Point[4]
For the bounding box location, it is because the native libraries (Google MLKit) return the native coordination, I tried to use the density to cover it back to Xamarin Forms but it still not quite accurate.
Anyone got a solution for this issue? Been trying to get a working solution for identifying the location of the BoundingBox property but I can't seem to get it working. Is it even possible?
https://github.com/tmoncorp/Xamarin.Barcode good luck
Any solutions to this?
Anyone got a solution for this issue? Been trying to get a working solution for identifying the location of the BoundingBox property but I can't seem to get it working. Is it even possible?
https://github.com/tmoncorp/Xamarin.Barcode good luck
this is perfect