ANDROID13 Random Background private int getRandomBackGroundColor() { String[] color_list = getContext().getResources().getStringArray(R.array.backgroundcolor_list); int random = (int)(Math.random() * (color_list.length - 2 ) ) + 1; return Color.parseColor(color_list[random]); } #ffffff #ccd1d9 #ec87cd #5d9cec #48cfad #ffce54 #ed5565 #a0d468 #000000 #434a54 #9889ca #03a3c7 #1eb6a9 #ebaf33 #dd1e30 #228556 2015. 10. 2. Android Image Crop시 사용 예제 Android Image Crop시 사용 예제Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(mImageCaptureUri, "image/*"); intent.putExtra("crop", "true"); intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageCaptureUri); intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString()); // intent.putExtra("outputX", 720); // crop한 이미지의 x축 크기 //intent.putExtra("outputY", 720); // .. 2015. 8. 10. BITMAP을 로컬 메모리에 저장하는 방법 public Uri getLocalBitmapUri(Bitmap bmp) { // Store image to default external storage directory Uri bmpUri = null; try { File file = new File(Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_DOWNLOADS), "share_image_" + System.currentTimeMillis() + ".png"); file.getParentFile().mkdirs(); FileOutputStream out = new FileOutputStream(file); bmp.compress(Bitmap.CompressFormat.PNG.. 2015. 7. 27. 이전 1 2 다음