Class ImageCropStyle
ResimKırpmaStili
Resim bileşenlerine uygulanabilecek bir kırpma stilini temsil eden sınıf. Bir resmin boyutunu ayarlayamaz veya yeniden boyutlandıramazsınız ancak resmi kırpabilirsiniz.
Ayrıntılı dokümanlar
setAspectRatio(ratio)
Kırpma türü RECTANGLE_CUSTOM
ise kullanılacak en boy oranını ayarlar. Oran pozitif bir değer olmalıdır.
Parametreler
Ad | Tür | Açıklama |
ratio | Number | Uygulanacak oran. |
Return
ImageCropStyle
: Zincirleme için bu nesne.
Atışlar
Error
: Giriş negatif veya sıfır ise.
setImageCropType(type)
Resmin kırpma türünü ayarlar. Varsayılan değer SQUARE'tır.
Parametreler
Return
ImageCropStyle
: Zincirleme için bu nesne.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-12-02 UTC.
[null,null,["Son güncelleme tarihi: 2024-12-02 UTC."],[[["`ImageCropStyle` allows cropping images within Google Apps Script, but not resizing them directly."],["Two main methods, `setAspectRatio` and `setImageCropType`, provide control over the cropping process."],["`setAspectRatio` is applicable only when using the `RECTANGLE_CUSTOM` crop type and requires a positive ratio value."],["`setImageCropType` lets you choose the shape of the crop, with `SQUARE` being the default option."],["Both methods return the `ImageCropStyle` object, enabling method chaining for streamlined code."]]],["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"]]