2016-06-30 68 views
1

我在這裏有一個問題,只要編輯器的意圖被激活,sdk自動將圖像保存到圖庫中。並且在編輯完成後再次進行一次。我如何防止在這裏自動保存?如何防止AdobeCreativeSDK自動將圖像保存到android手機?

Adob​​eImageEditorActivity.class

protected void performSave(Bitmap bitmap, Uri saveUri, CompressFormat outputFormat, int quality, boolean hires, AdobeImageEditorActivity.FinalAction action) { 
     logger.info("performSave, uri:%s, quality: %d, action:%s", new Object[]{saveUri, Integer.valueOf(quality), action}); 
     File destFile; 
     if(saveUri != null) { 
      destFile = new File(saveUri.getPath()); 
     } else { 
      destFile = this.getDefaultOutputDestination(outputFormat); 
     } 

     try { 
      logger.log("trying to create the new file..."); 
      if(!destFile.exists() && !destFile.createNewFile()) { 
       logger.error("Failed to create the file"); 
      } 
     } catch (IOException var11) { 
      var11.printStackTrace(); 

      try { 
       logger.error("using a temporary file!"); 
       destFile = File.createTempFile("aviary-image-", ".jpeg"); 
      } catch (IOException var10) { 
       var10.printStackTrace(); 
      } 
     } 

     LocalDataService service = (LocalDataService)this.getMainController().getService(LocalDataService.class); 

     assert service != null; 

     service.setDestImageUri(Uri.parse(destFile.getAbsolutePath())); 
     AdobeImageEditorActivity.SaveHiResImageTask mSaveTask = new AdobeImageEditorActivity.SaveHiResImageTask(destFile, action, outputFormat, quality, hires); 
     mSaveTask.execute(new Bitmap[]{bitmap}); 
    } 

我實現了上面的代碼可能是實際執行的是保存,但它是一個自動生成的文件,有沒有什麼辦法,我可以做,以防止儲蓄髮生?

回答

0

自動保存與圖像編輯器

當用戶關閉圖像編輯器創意SDK圖像編輯器保存編輯的圖像。這是不可能的,以防止這種行爲。

保存的圖像Uri被傳回到您的應用的onActivityResult()方法的活動中。有關基本演示,請參閱this sample app on GitHub

口述其中經編輯的圖像被保存

,能夠決定在編輯後的圖像是通過使用withOutput()方法,傳遞一個File保存。

您可以在the Creative SDK developer portal's Image Editor guide上看到所有可選的方法。

請注意,開發者門戶網站目前聲明您應通過UriwithOutput(),但這是不正確的。您應該通過File

​​
相關問題