<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                @UIImagePickerController 類是獲取選擇圖片和視頻的用戶接口。我們可以用這個controller選擇我們所需要的圖片和視頻。對于這個類來說比較特殊,我們不能夠任意定制,也不可以繼承生成子類。 1.當前設備是否支持使用UIImagePickerController,需要調用 ? ? ?[UIImagePickerController?isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]; 2.查看符合的媒體類型(圖片或者視頻,調用availableMediaTypesForSourceType: 方法判斷。 3.sourceType(從哪選取媒體) ???// 打開圖片庫根目錄選擇 ? ?UIImagePickerControllerSourceTypePhotoLibrary ? ?// 使用相機選擇 ? ?UIImagePickerControllerSourceTypeCamera ? ?// 打開SavedPhoto目錄選擇 ? ?UIImagePickerControllerSourceTypeSavedPhotosAlbum 4.先創建一個UIImagePickerController(可以用模態推出相冊或UIActionSheet推出) ~~~ @實現協議UIImagePickerControllerDelegate _imagePickerC = [[UIImagePickerController alloc] init]; _imagePickerC.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; _imagePickerC.allowsEditing = YES; _imagePickerC.delegate = self; [self presentModalViewController: _imagePickerC animated: YES]; ~~~ ? ? allowEditing 設置為YES,表示 允許用戶編輯圖片,否則,不允許用戶編輯。 5.兩個主要的委托方法 ~~~ // 用戶選中圖片之后的回調 - (void)imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo: (NSDictionary *)info { if (picker == picker_camera_) { //如果是 來自照相機的image,那么先保存 UIImage* original_image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; } // info dictionary keys UIKIT_EXTERN NSString *const UIImagePickerControllerMediaType; // an NSString (UTI, i.e. kUTTypeImage) UIKIT_EXTERN NSString *const UIImagePickerControllerOriginalImage; // a UIImage UIKIT_EXTERN NSString *const UIImagePickerControllerEditedImage; // a UIImage UIKIT_EXTERN NSString *const UIImagePickerControllerCropRect; // an NSValue (CGRect) UIKIT_EXTERN NSString *const UIImagePickerControllerMediaURL; // an NSURL UIKIT_EXTERN NSString *const UIImagePickerControllerReferenceURL NS_AVAILABLE_IOS(4_1); // an NSURL that references an asset in the AssetsLibrary framework UIKIT_EXTERN NSString *const UIImagePickerControllerMediaMetadata NS_AVAILABLE_IOS(4_1); // an NSDictionary containing metadata from a captured photo // 獲得編輯過的圖片 UIImage* image = [info objectForKey: @"UIImagePickerControllerEditedImage"]; // 把圖片轉成NSData類型的數據來保存文件(存入到沙盒中) NSData *imageData; // 判斷圖片是不是png格式的文件 if (UIImagePNGRepresentation(image)) { // 返回為png圖像。 imageData = UIImagePNGRepresentation(image); }else { // 返回為JPEG圖像 imageData = UIImageJPEGRepresentation(image, 1.0); } // 路徑拼接,寫入----- NSString * imageSavePath = [[[HMTMySqliteDataHandle shareInstance]saveImagesPath] stringByAppendingPathComponent:@"自定義.自定義"]; [imageData writeToFile:imageSavePath atomically:YES]; // 關閉相冊界面 [self dismissModalViewControllerAnimated:YES]; [picker release]; } // 用戶選擇取消 - (void) imagePickerControllerDidCancel: (UIImagePickerController *)picker { // 關閉相冊界面 [self dismissModalViewControllerAnimated:YES]; [picker release]; } ~~~ @[?UIImagePickerController詳解](http://blog.csdn.net/kingsley_cxz/article/details/9157093)?? @??[UIImagePickerController](http://blog.csdn.net/rhljiayou/article/details/8003939)?任海麗(3G移動/開發) @[iOS攝像頭和相冊-UIImagePickerController-淺析](http://blog.sina.com.cn/s/blog_7b9d64af0101cfd9.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看