我工作的圖片選擇/作物程序及以下使用此代碼:Android MediaStore裁剪功能,如何使選擇箭頭始終可見?
http://www.androidworks.com/crop_large_photos_with_android/comment-page-1#comment-969
至於我能理解,我們設置屬性與把羣衆演員我們的意圖像下面的代碼。
爲了改變選擇區域,我們需要觸摸邊框,然後箭頭變得可見,但我想要做的是使它們始終可見,因爲很難讓用戶理解這種方式。 Instagram的Android應用程序這樣做,所以我想有一種方法可以做到這一點。
謝謝。
Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", aspectX);
intent.putExtra("aspectY", aspectY);
intent.putExtra("outputX", outputX);
intent.putExtra("outputY", outputY);
intent.putExtra("scale", scale);
intent.putExtra("return-data", return_data);
intent.putExtra(MediaStore.EXTRA_OUTPUT, getTempUri());
編輯/解決方案: 感謝@Renard我發現像這樣的解決方案:
我用這個庫的源代碼: http://gitorious.org/0xdroid/packages_apps_gallery3d/trees/3c02f2877dc2f8f0b5c01d03fa2b487c040e4000
我嘗試了一些其他的畫廊資源的代碼太多,但這是最容易維護的一個。
你只需要刪除以下,如果檢查中Highlightview.java類的Draw()函數:
if (mMode == ModifyMode.Grow)
當你這樣做,它的作品,但箭頭repating本身,而爲了避免移動和您需要更改moveBy()方法的最後一行是:
mContext.invalidate(invalRect);
與此:
mContext.invalidate();
嗨我想裁剪從相機捕獲的圖像,任何想法? – AB1209 2014-03-17 06:35:53