android-bitmap

Why I get defected image from ImageCropper( android wallpaper app)?

倖福魔咒の 提交于 2019-12-13 02:23:39
问题 I am making android wallpaper app. At the start, I didn't use imagecropper and background image for android was very perfect. Then I wanted to add ImageCropper function and I noticed the problem: Image that I got from ImageCropper was very defected and bad quality. I am sure that the problem is here: (Performcrop method(starts activity for result)) public void performCrop(Uri picUri, Bitmap qq){ try { utils = new Utils(getApplicationContext()); int height, width; Display display =

Is Android's ARGB_8888 Bitmap internal format always RGBA?

帅比萌擦擦* 提交于 2019-12-12 12:48:51
问题 I am trying to create a Bitmap in Android using the Bitmap.Config.ARGB_8888 after I have received the bytes from an external source. As I understand the fastest way to set raw bytes in a Bitmap (without using JNI ) is by using the copyPixelsFromBuffer() method, however the question arises regarding the correct order of the bytes in that buffer. After some trial and error, and despite the fact that Config.ARGB_8888 suggests a correct order of ARGB it seems that the internal format used by

Android: out of memory error when using bitmaps

萝らか妹 提交于 2019-12-12 06:49:25
问题 i often get out of memory errors in my app. I believe it has to do with the bitmaps i download from the server. Any ideas why? **A method in my activity that sets up ListView:** private class NewsFeedArrayAdapter extends ArrayAdapter<AnimalLocationLog> { ArrayList<AnimalLocationLog> objects; Context context; ArrayList<String> urls; ImageDownloader downloader; public NewsFeedArrayAdapter(Context context, int textViewResourceId, ArrayList<AnimalLocationLog> objects, ArrayList<String> urls) {

Android storage access framework persistable permission not granted during asyntask

半腔热情 提交于 2019-12-12 03:46:54
问题 I set the intent flags here: public void createAlbum(View view) { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION); String intentChooserDialog = getResources().getString(R.string.pick_image_dialog); startActivityForResult(Intent.createChooser(intent, intentChooserDialog), PICK

Xamarin Android - Bitmap Drawables to Int array for ViewPager

喜欢而已 提交于 2019-12-12 02:18:29
问题 I am storing some images locally on the device as compressed bitmaps. To retrieve them i get them from their file path, decode them, and then store them as BitmapDrawables. I now need to use these bitmapDrawables to populate a viewPager. This is the code that effectively gets all my bitmaps into a bitmap array: public void getMySeenExhibits() { string[] myImages; myImages = DBconnection.getAllImageURLs (conn); // sqLite connection - this gets all the file paths from SqLite List<Drawable>

Bitmap inside white circle

你说的曾经没有我的故事 提交于 2019-12-12 02:17:20
问题 I'm trying to fill Bitmap inside white circle, more specifically: I've a Bitmap for example this: And I want this: I've make background gray for understand image. I use this method, but it doesn't make what I want.. public static Bitmap getRoundedBitmap(Bitmap bitmap) { final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(output); final int color = Color.WHITE; final Paint paint = new Paint(); final Rect

How to set an image taken by the camera in to an ImageView?

浪子不回头ぞ 提交于 2019-12-12 02:12:44
问题 I am using camera 2 API for creating my own camera. I want to set the image taken by the camera in to an ImageView , which is on another activity. I have tried this code but it is not working. When clicking the camera button the photo is saved to an sdcard location, but it is not showing on the ImageView in the third Activity (which should receive the image and set it to an ImageView). I am passing the image as bitmap object via an Intent . Can anyone help me? Camera Activity public class

Get resource ID from URI or Bitmap

时间秒杀一切 提交于 2019-12-12 02:02:45
问题 Is there anyway I can find resource ID from Bitmap, URI, file path or file name of an image? These images are written by my app. So is there any chance I can find the resource ID? Basically, I have GIF images stored in my SD Card (which are created by my app). I want to load those images to my viewer. For that, I am using GIF Movie View library. In that file, setMovieResource() expecting an int (resource ID). But I have all other info like bitmap, absolute path. 回答1: Resource IDs are

How to select an image from gallery or to capture a photo and then to display it in another activity full quality

扶醉桌前 提交于 2019-12-12 01:43:33
问题 I have two image buttons,for camera and gallery . If you select "camera" you can capture a photo from camera and then that photo has to be displayed in another activity in image view. If you select "gallery" then you have to select a photo from gallery and then that photo has to be display it in another activity . My code for gallery works fine . I created two others activities(with the same layout), one for gallery and the other for camera. But the code for camera doesn't work . Here is my

Smooth endles scrolling background with canvas?

*爱你&永不变心* 提交于 2019-12-11 23:45:14
问题 Welcome all I have a background image and what I want is for it to be moving slowly to the right and when the image has reach the right end of the screen with the end of the left starting side of the image, the image must start again showing the start of the right side, as an infinite horizontal scroll. How can this be achieved without generating bitmap overflow memory exceptions? I tryed it drawing two times the bitmap with canvas... but it is not smooth, it is very creepy with jumps and not