To adjust the position of the content in a cropped image, please review the crop mode parameter.įinds the area containing all faces, or a specific face in an image, and scales it to specified width and height dimensions. This is the original image at 300×200 size with no parameters applied.įit=crop&w=300&h=100: Resizing the image to 300×100 with fit=crop will fit the image exactly to those dimensions.įit=crop&w=200&h=200: Setting an equal value for width and height along with fit=crop will always result in a square image. Both the w and h parameters will also need to be set. It's used in conjunction with the the crop parameter, which controls how the image is cropped. The resulting image will match the width and height constraints without distorting the image. Resizes the image to fill the width and height dimensions and crops any excess image data. clip is the default, so is not necessary.įit=clip&w=100&h=100: Attempting to resize this image to be 100×100 with a fit mode of clip will result in an image that is 100×67 because the aspect ratio of the original image is maintained. Unset: This is the original image at 300×200 with no parameters applied. The resulting image will match one of the constraining dimensions, while the other dimension is altered to maintain the same aspect ratio of the input image. Resizes the image to fit within the width and height boundaries without cropping or distorting the image. The pixel extension is called an affine clamp, hence the value name, "clamp".ĭefault. The resulting image will match the constraining dimensions. Resizes the image to fit within the width and height dimensions without cropping or distorting the image, and the remaining space is filled with extended pixels from the edge of the image. Valid values are clamp, clip, crop, facearea, fill, fillmax, max, min, and scale. TypeĮnum( 'cover', 'contain', 'fill', 'scale-down')Ĭhanges the color of all the non-transparent pixels to the tintColor.The fit parameter controls how the output image is fit to its target dimensions after resizing, and how any background areas will be filled. If the image is larger than the view, scale it down uniformly so that it is contained in the view.Įnum( 'cover', 'contain', 'stretch', 'repeat', 'center')ĭetermines how to resize the image when the frame doesn't match the raw image dimensions. The image will keep its size and aspect ratio, unless it is larger than the view, in which case it will be scaled down uniformly so that it is contained in the view.Ĭenter: Center the image in the view along both dimensions. Repeat: Repeat the image to cover the frame of the view. Stretch: Scale width and height independently, This may change the aspect ratio of the src. At least one dimension of the scaled image will be equal to the corresponding dimension of the view (minus padding)Ĭontain: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).Both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).Defaults to cover.Ĭover: Scale the image uniformly (maintain the image's aspect ratio) so that: Typeĭetermines how to resize the image when the frame doesn't match the raw image dimensions. Certain resize modes, such as 'contain'Ī typical way to use this prop is with images displayed on a solid background and setting the overla圜olor to the same color as the background.įor details of how this works under the hood, see Fresco documentation.This is useful in cases which are not supported by the Android implementation of rounded corners: When the image has rounded corners, specifying an overla圜olor will cause the remaining space in the corners to be filled with a solid color.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |