-3
A
回答
1
做這樣的事情:
Intent intent = new Intent("com.android.camera.action.CROP");
// this will open all images in the Galery
intent.setDataAndType(photoUri, "image/*");
intent.putExtra("crop", "true");
// this defines the aspect ration
intent.putExtra("aspectX", aspectY);
intent.putExtra("aspectY", aspectX);
// this defines the output bitmap size
intent.putExtra("outputX", sizeX);
intent.putExtra("outputY", xizeY);
// true to return a Bitmap, false to directly save the cropped iamge
intent.putExtra("return-data", false);
//save output image in uri
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
-2
<ImageView
android:id="@+id/imgProfilePic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/image"
android:scaleType="fitCenter" <!-- TO CROP/SCALE -->
android:gravity="center" <!-- TO MOVE -->
/>
希望這可以幫助你
相關問題
- 1. 移動和縮放圖像
- 2. 如何放大和縮小圖像並移動所有圖像
- 3. 縮放和移動SVG圖像
- 4. 圖像縮放和平移
- 5. 圖像平移和縮放
- 6. 如何通過拖動邊緣來移動和縮放圖像?
- 7. 移動自動縮放圖像
- 8. 如何一起移動和縮放圖像
- 9. 如何正確移動和縮放圖像?
- 10. 圖像縮放/移動/歪斜控制
- 11. 花式盒 - 圖像縮放移動
- 12. 在移動設備上縮放圖像
- 13. 圖像互相移動縮放效果
- 14. 僅縮放移動Safari中的圖像
- 15. 在mousemove上移動縮放圖像
- 16. 如何在滾動視圖中縮放/平移圖像
- 17. 縮放和平移QScrollArea中的圖像
- 18. 縮放和平移圖像畫布
- 19. 平移和縮放圖像的jQuery Mobile
- 20. 縮放UIImageView和移動縮放
- 21. 圖像動畫移動和縮放在一起
- 22. 在滾動JavaScript庫上縮放和移動背景圖像
- 23. 如何在Android中實現iPhone像「移動和縮放」功能的圖像?
- 24. 在html和javascript中移動和縮放圖像
- 25. 使用KineticJs縮放和移動繪圖
- 26. 同時縮放和移動圖層
- 27. 如何使主頁滑塊圖像不縮放移動?
- 28. 如何動態縮放pdf圖像
- 29. 如何縮放滾動的圖像?
- 30. Three.js:如何縮放和偏移我的圖像紋理?
是否可以裁剪使用該圖像的選定部分? –
你所有的問題都已經有了答案:[移動圖像] [1],[縮放圖片] [2]和[剪切圖像] [3] [1]:http://stackoverflow.com/問題/ 8696025 /如何在Android上移動圖像 - 屏幕上的圖像 [2]:http://stackoverflow.com/questions/2521959/how-to-scale-an-image -in-imageview-keep-the-aspect-ratio [3]:http://stackoverflow.com/questions/3725501/how-to-crop-the-parsed-image-in-android – slezadav