Class ImageCropStyle
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이미지자르기스타일
이미지 구성요소에 적용할 수 있는 자르기 스타일을 나타내는 클래스입니다. 이미지의 크기를 설정하거나 크기를 조절할 수는 없지만 이미지를 자르기는 할 수 있습니다.
자세한 문서
setAspectRatio(ratio)
자르기 유형이 RECTANGLE_CUSTOM인 경우 사용할 가로세로 비율을 설정합니다. 비율은 양수여야 합니다.
매개변수
| 이름 | 유형 | 설명 |
ratio | Number | 적용할 비율입니다. |
리턴
ImageCropStyle: 연결을 위한 객체입니다.
생성 값
Error: 입력이 음수 또는 0인 경우
setImageCropType(type)
이미지의 자르기 유형을 설정합니다. 기본값은 SQUARE입니다.
매개변수
리턴
ImageCropStyle: 연결을 위한 객체입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],["The `ImageCropStyle` class allows users to crop images without resizing them. Key actions include setting the image crop type using `setImageCropType`, which defaults to SQUARE. For a `RECTANGLE_CUSTOM` crop type, you can set the aspect ratio via `setAspectRatio`, which requires a positive numeric value. Both methods return the `ImageCropStyle` object, enabling method chaining. `setAspectRatio` throws an error if the ratio is zero or negative.\n"]]