Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. 11-26 19:16:34.100: E/AndroidRuntime(17871): java.lang.IllegalArgumentException: Textures with dimensions8192x4096 are larger than the maximum supported size 4096x4096
  2.  
  3. public void onMapClick(LatLng point) {
  4. Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
  5. File photo = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");
  6. intent.putExtra(MediaStore.EXTRA_OUTPUT,
  7. Uri.fromFile(photo));
  8. imageUri = Uri.fromFile(photo);
  9. startActivityForResult(intent, TAKE_PICTURE);
  10. }
  11.  
  12. public void onActivityResult(int requestCode, int resultCode, Intent data) {
  13. super.onActivityResult(requestCode, resultCode, data);
  14. switch (requestCode) {
  15. case TAKE_PICTURE:
  16. if (resultCode == Activity.RESULT_OK) {
  17. Uri selectedImage = imageUri;
  18. getContentResolver().notifyChange(selectedImage, null);
  19. ContentResolver cr = getContentResolver();
  20. Bitmap bitmap;
  21. try {
  22. bitmap = android.provider.MediaStore.Images.Media
  23. .getBitmap(cr, selectedImage);
  24.  
  25. BitmapFactory.Options options = new BitmapFactory.Options();
  26. options.inPreferredConfig = Bitmap.Config.ARGB_8888;
  27. options.inSampleSize = 1;
  28. options.inDensity = DisplayMetrics.DENSITY_MEDIUM;
  29. options.inTargetDensity = getApplication().getResources().getDisplayMetrics().densityDpi;
  30. options.inScaled = true;
  31. options.inJustDecodeBounds = false;
  32. MarkerOptions markerOptions = new MarkerOptions()
  33. .position(point)
  34. .icon(BitmapDescriptorFactory
  35. .fromBitmap(bitmap));
  36. googleMap.addMarker(markerOptions);
  37.  
  38. Toast.makeText(this, selectedImage.toString(),
  39. Toast.LENGTH_LONG).show();
  40. } catch (Exception e) {
  41. Toast.makeText(this, "Failed to load", Toast.LENGTH_SHORT)
  42. .show();
  43. Log.e("Camera", e.toString());
  44. }
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement