RightpointLabs.Pourcast.Infrastructure.Services.FaceRecognitionService.GetTagBoundingBox C# (CSharp) Méthode

GetTagBoundingBox() private méthode

Get the bounding box of the face. Center, width, and height are percent-of-image. Convert them to absolute pixels (needed for our marker/crop algorithms)
private GetTagBoundingBox ( Tag tag, Bitmap image ) : Rectangle
tag Tag
image System.Drawing.Bitmap
Résultat System.Drawing.Rectangle
        private Rectangle GetTagBoundingBox(Tag tag, Bitmap image)
        {
            return new Rectangle(
                (int)((tag.Center.X - tag.Width / 2) * image.Width / 100),
                (int)((tag.Center.Y - tag.Height / 2) * image.Height / 100),
                (int)(tag.Width * image.Width / 100),
                (int)(tag.Height * image.Height / 100));
        }