Following is my code to select multiple image from gallery. But don't know why its not working. I am able to select only one image at a time from gallery. But from Recent items I am able to select multiple images.I want to select multiple items from gallery also. so what changes I should made for that?
var imageIntent = new Intent ();
imageIntent.SetType ("image/*");
imageIntent.SetAction (Intent.ActionPick);
imageIntent.PutExtra (Intent.ExtraAllowMultiple,true);
StartActivityForResult (Intent.CreateChooser (imageIntent, "Select photo"), 0);
There are 2 ways to implement multi-selection of images in gallery:
Intent for getting multiple images
Define custom gallery with fetching and loading photos from native gallery.
Try out this Samples :
https://github.com/PareshMayani/Gallery-MultiPhotoSelect
http://www.technotalkative.com/android-select-multiple-photos-from-gallery/
Related
I want to show the image selecting option like whatsapp , first fetch list of all the album and then by clicking on that album all the photo should come and being able to keep track of all photo selected by user . i.e Multiple photo selection.enter image description here
I have attached the image to show the requirement.
Please help me.
Thanks in advance
You have to use asset library for it,
Here are some libraries you could use:
1. LimPicker (Similar to WhatsApp's image picker)
2. Fusuma(Instagram like image selector)
3. YangMingShan(Yahoo like image selector)
I am trying to upload a photo from UIWebView that has a HTML form for image upload, after clicking the button it gives me two options:
1.Take Photo
2.Photo Library
but when I select photo from library it shows below message in console:
creating an image format with an unknown type is an error
Currently using Xcode 8.3.2. Any idea how to resolve it?
I guess it is a bug in xcode. If you select images from gallery and camera and it return images prorerly. That means your images is right and you can ignore this. If you are not getting return images. That means your image is not right formate.
We develop an app with some features in iPhone 6s.
I faced some issue when showing the contact image in the shortcut item. I am able to show the dummy image, but I am unable to dynamically fetch the contact image and show in the shortcut items.
My images are in documents directory. I need to show in shortcut item.
UIApplicationShortcutIcon iconWithTemplateImageName: --------]
I tried this:
UIApplicationShortcutIcon * photoIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:SaveImage.png];
I can show a direct local image, but I cannot show the image from addressbook.
Any recommendations are welcome.
This question is confusing. You say your images are "in the documents directory", but you want to display images from the address book.
What I recommend doing is getting the contact you want from the CNContactStore (a CNContact has an image attribute named imageData) and then pass it to UIApplicationShortcutIcon which has an init method that takes a CNContact as a parameter (which means it would actually use that image).
I want to take a photo and save them within a custom album on a iPad.
I tried a lot of things but ended always with wrong image orientation.
My current procedure is:
Take photo with Xamarin.Media and safe image somewhere in my app path
Create custom album if it's not existing
Load image from temporary path and save to the album
Add the image (asset) additionally to the custom album created in 2.
The workflow above is fully working except of saving the correct orientation. After loading an image with library.AssetForUrl() the containing orientation is every time up. Also after converting from asset -> CGImage -> UImage (uiImage.Orientation).
In step 3 I tried to set the orientation the the appropriate one with
var image = new UIImage(tempImage.CGImage, 1.0f, UIImageOrientation.MyOrientation)
and also with the save command
library.WriteImageToSavedPhotosAlbum(image.CGImage, myOrientation, SaveCompletionBlock)
But the orientation is still ignored. I checked this by opening the Album application as well as loading the file in my self written gallery app.
I want to avoid the use of the iOS picker to take photos. This will produce a mess of code!
Or is there any third party library which allows to take photos and store them in a custom album? Which takes care of all the metadata information? It doesn't matter if it's written in objective-c or c#. I will create bindings for it. But it's awful to work with the camera and albums in iOS.
There are tons of hand-made UIImagePickerController alternatives. Some of them:
https://github.com/w5mith/WSAssetPickerController
https://github.com/chute/photo-picker-plus-ios
https://github.com/B-Sides/ELCImagePickerController
What I try to achieve is to take a photo and let the user specify if the photo belongs to category 1 or category 2. I have 2 buttons, one for each category. When the user presses the button, the photo is saved to the camera roll. AFterwards, at home, when I sync my iPad with iPhoto, I want to be able to sort by category, or at least identify to with category it belongs...
I first thought of the following :
1) taking a photo using the iPad camera -- this is already done in my app
2) saving the photo in camera roll under a specific name, such as cat1_pict123.jpg or cat2_pict456.jpg
I would plan to use
UIImageWriteToSavedPhotosAlbum(myImage, nil, nil, nil );
but I don't know how / or if it is possible to specify a file name ?
Alternatively, is there a way to "tag" a photo before saving it to camera roll ? A comment or something else, which will be visible in iPhoto ?
Thank you for your help
You can't use file names for images saved in photolibrary.
Save that to Document directory with specific name.
There is a way to kinda do that, by setting the image IPTC metadata:
Set the field "Object Name" to set the image title in
iPhoto.
Set the field "Keywords" to set the keywords in
iPhoto, then use a smart album to see all the images with these
keywords.
See details (and code) at http://ootips.org/yonat/how-to-set-the-image-name-when-saving-to-the-camera-roll/ .
That's not possible right now.