public synchronized void adjustFramingRect(int deltaWidth, int deltaHeight) {
    if (initialized) {
      Point screenResolution = configManager.getScreenResolution();

      // Set maximum and minimum sizes
      if ((framingRect.width() + deltaWidth > screenResolution.x - 4) || (framingRect.width() + deltaWidth < 50)) {
        deltaWidth = 0;
      }
      if ((framingRect.height() + deltaHeight > screenResolution.y - 4) || (framingRect.height() + deltaHeight < 50)) {
        deltaHeight = 0;
      }

      int newWidth = framingRect.width() + deltaWidth;
      int newHeight = framingRect.height() + deltaHeight;
      int leftOffset = (screenResolution.x - newWidth) / 2;
      int topOffset = (screenResolution.y - newHeight) / 2;
      framingRect = new Rect(leftOffset, topOffset, leftOffset + newWidth, topOffset + newHeight);
      framingRectInPreview = null;
    } else {
      requestedFramingRectWidth = deltaWidth;
      requestedFramingRectHeight = deltaHeight;
    }
  }
Changes the size of the framing rect.

@param deltaWidth Number of pixels to adjust the width
@param deltaHeight Number of pixels to adjust the height
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/camera/CameraManager.java