<GCKUIImagePicker> پروتکل
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
شیء مورد استفاده برای انتخاب یک تصویر برای یک هدف معین از یک شیء GCKMediaMetadata .
یک پیادهسازی پیشفرض به صورت داخلی توسط چارچوبی که همیشه اولین تصویر را از ابرداده برای همه کاربردها انتخاب میکند، استفاده میشود. این برنامه می تواند با تنظیم ویژگی GCKCastContext::imagePicker یک پیاده سازی سفارشی ارائه دهد.
- از آنجا که
- 3.0
<NSObject> را به ارث می برد.
تصویری از نوع مشخص شده را از فراداده رسانه برمیگرداند.
- Parameters
-
imageHints | The hints about how to pick the image. |
metadata | The media metadata to pick from. |
- برمی گرداند
- تصویر انتخاب شده، یا اگر تصویر مناسبی برای نوع درخواستی وجود نداشته باشد،
nil
.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eGCKUIImagePicker\u003c/code\u003e protocol helps select images from \u003ccode\u003eGCKMediaMetadata\u003c/code\u003e objects for display within the Google Cast framework.\u003c/p\u003e\n"],["\u003cp\u003eBy default, the first image in the metadata is used, but apps can customize image selection via \u003ccode\u003eGCKCastContext::imagePicker\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetImageWithHints:fromMetadata:\u003c/code\u003e method fetches a specific image type from the metadata based on provided hints.\u003c/p\u003e\n"],["\u003cp\u003eIf no suitable image is found matching the desired type, this method will return \u003ccode\u003enil\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `GCKUIImagePicker` protocol selects an image from `GCKMediaMetadata`. It has a default implementation that selects the first image. Custom implementations can be provided via `GCKCastContext::imagePicker`. The key method, `getImageWithHints:fromMetadata:`, retrieves an image based on `GCKUIImageHints` from provided metadata. It returns the selected `GCKImage` or `nil` if no suitable image is found. This enables picking specific image types for different purposes.\n"],null,["# <GCKUIImagePicker> Protocol\n\n[Instance Methods](#pub-methods) \n\\\u003cGCKUIImagePicker\\\u003e Protocol Reference \n\nOverview\n--------\n\nAn object used for selecting an image for a given purpose from a [GCKMediaMetadata](/cast/docs/reference/ios/interface_g_c_k_media_metadata \"A container for media metadata. \") object.\n\nA default implementation is used internally by the framework which always selects the first image from the metadata for all uses. The application can provide a custom implementation by setting the [GCKCastContext::imagePicker](/cast/docs/reference/ios/category_g_c_k_cast_context_07_u_i_08#ada8e8d94275d23c230956e5146d19633 \"The image picker implementation that will be used to select an image for a specific purpose...\") property.\n\nSince\n: 3.0\n\nInherits \\\u003cNSObject\\\u003e.\n\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (nullable [GCKImage](/cast/docs/reference/ios/interface_g_c_k_image) \\*) | - [getImageWithHints:fromMetadata:](/cast/docs/reference/ios/protocol_g_c_k_u_i_image_picker-p#ae99a4131372312a99342b24e8831c561) |\n| | Returns an image of the specified type from the media metadata. [More...](#ae99a4131372312a99342b24e8831c561) |\n| ||\n\nMethod Detail\n-------------\n\n|-----------------------------------------------------------------------------------------------|---|----------------------------------------------------------------------------------------|--------------|\n| - (nullable [GCKImage](/cast/docs/reference/ios/interface_g_c_k_image) \\*) getImageWithHints: | | ([GCKUIImageHints](/cast/docs/reference/ios/interface_g_c_k_u_i_image_hints) \\*) | *imageHints* |\n| fromMetadata: | | (const [GCKMediaMetadata](/cast/docs/reference/ios/interface_g_c_k_media_metadata) \\*) | *metadata* |\n| | | | |\n\nReturns an image of the specified type from the media metadata.\n\nParameters\n:\n\n |------------|----------------------------------------|\n | imageHints | The hints about how to pick the image. |\n | metadata | The media metadata to pick from. |\n\n\nReturns\n: The selected image, or `nil` if there is no appropriate image for the requested type."]]