Class ImageCropStyle
سبک برش تصویر کلاسی که نشان دهنده یک سبک برش است که می تواند برای اجزای تصویر اعمال شود. شما نمی توانید اندازه یک تصویر را تنظیم کنید یا اندازه آن را تغییر دهید، اما می توانید تصویر را برش دهید.
مستندات دقیق
set Aspect Ratio(ratio)
اگر نوع برش RECTANGLE_CUSTOM
باشد، نسبت تصویر را برای استفاده تنظیم میکند. نسبت باید یک مقدار مثبت باشد.
پارامترها
نام | تایپ کنید | توضیحات |
---|
ratio | Number | نسبت به اعمال. |
بازگشت
Image Crop Style
- این شی، برای زنجیر کردن.
پرتاب می کند
Error
- اگر ورودی منفی یا صفر باشد.
set Image Crop Type(type)
نوع برش را برای تصویر تنظیم می کند. پیش فرض SQUARE است.
پارامترها
بازگشت
Image Crop Style
- این شی، برای زنجیر کردن.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-12-02 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-12-02 بهوقت ساعت هماهنگ جهانی."],[[["`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"]]