ZXing.PDF417.Internal.BoundingBox.Create C# (CSharp) Method

Create() public static method

Initializes a new instance of the ZXing.PDF417.Internal.BoundingBox class. returns null if the corner points don't match up correctly
public static Create ( BitMatrix image, ResultPoint topLeft, ResultPoint bottomLeft, ResultPoint topRight, ResultPoint bottomRight ) : BoundingBox
image ZXing.Common.BitMatrix The image.
topLeft ResultPoint The top left.
bottomLeft ResultPoint The bottom left.
topRight ResultPoint The top right.
bottomRight ResultPoint The bottom right.
return BoundingBox
      public static BoundingBox Create(BitMatrix image,
                                       ResultPoint topLeft,
                                       ResultPoint bottomLeft,
                                       ResultPoint topRight,
                                       ResultPoint bottomRight)
      {
         if ((topLeft == null && topRight == null) ||
             (bottomLeft == null && bottomRight == null) ||
             (topLeft != null && bottomLeft == null) ||
             (topRight != null && bottomRight == null))
         {
            return null;
         }

         return new BoundingBox(image, topLeft, bottomLeft,topRight, bottomRight);
      }

Same methods

BoundingBox::Create ( BoundingBox box ) : BoundingBox

Usage Example

        // TODO convert this to a dictionary? Dictionary<imageRow, Codeword> ??

        /// <summary>
        /// Initializes a new instance of the <see cref="ZXing.PDF417.Internal.DetectionResultColumn"/> class.
        /// </summary>
        /// <param name="box">The Bounding Box around the column (in the BitMatrix)</param>
        public DetectionResultColumn(BoundingBox box)
        {
            this.Box       = BoundingBox.Create(box);
            this.Codewords = new Codeword[Box.MaxY - Box.MinY + 1];
        }
All Usage Examples Of ZXing.PDF417.Internal.BoundingBox::Create