ImageResizeMode.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict
  8. * @format
  9. */
  10. 'use strict';
  11. /**
  12. * ImageResizeMode defines valid values for different image resizing modes set
  13. * via the `resizeMode` style property on `<Image>`.
  14. */
  15. export type ImageResizeMode =
  16. // Resize by scaling down such that it is completely visible, if bigger than
  17. // the area of the view. The image will not be scaled up.
  18. | 'center'
  19. // Resize such that it will be completely visible, contained within the frame
  20. // of the View.
  21. | 'contain'
  22. // Resize such that the entire area of the view is covered by the image,
  23. // potentially clipping parts of the image.
  24. | 'cover'
  25. // Resize by repeating to cover the frame of the View. The image will keep its
  26. // size and aspect ratio.
  27. | 'repeat'
  28. // Resize by stretching it to fill the entire frame of the view without
  29. // clipping. This may change the aspect ratio of the image, distorting it.
  30. | 'stretch';