How to create a bounding box (or any shape) programatically in .NET MAUI 7?

Arafat Tehsin 5 Reputation points MVP
2023-05-21T23:30:20.6666667+00:00

Recently, I've read so many blogs but then there comes a newest official documentation on .NET MAUI's GraphicsView. This document changes a lot of approaches written earlier. I want to know that considering GraphicsView, how can I create a bounding box programmatically?

My scenario

I have got a picture (image) which is already loaded on a .NET MAUI app, I want to create N (where N is >= 1) rectangles on it based upon my logic and coordinates specific to that image. So basically a bounding box against each object inside an image.

Problem

I have got all the coordinates, logic etc. in place. It works fine in my UWP app (I know it's a legacy thing now, just wanted to test my logic) but now I want to create a shape programatically on that image and I can't find it how. The GraphicsView documentation doesn't explain this part. Although they did a great job in writing a shapes code but I want something paramaterised.

Developer technologies | .NET | .NET MAUI
Developer technologies | .NET | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.