How to save Image from Iphone Camera to project directory other than photo album - Mono touch

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to save Image from Iphone Camera to project directory other than photo album - Mono touch

gill.saqib
Hi Guys,

I am new bee to mono development, i need some help with iphone camera integration.

I want to capture image from iphone camera and save the image in to mono project folder not into photo album.

Thanks!

Regards,
Gill
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to save Image from Iphone Camera to project directory other than photo album - Mono touch

Craig Dunn
Hey,

so you might have already seen this example
grab that code, then in ImageViewController.cs : add this code to the TweetStation.Camera.TakePicture handler. Note that it isn't saving the GPS  or other photo/camera metadata, *just* the image itself.

var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal);

string jpgFilename = System.IO.Path.Combine (documentsDirectory, "Photo.jpg"); // hardcoded filename, overwrites each time

NSData imgData = photo.AsJPEG();

NSError err = null;

if (imgData.Save(jpgFilename, false, out err))

{

    Console.WriteLine("saved as " + jpgFilename);

} else {

    Console.WriteLine("NOT saved as" + jpgFilename + " because" + err.LocalizedDescription);

}



HTH
craig


On Thu, Apr 26, 2012 at 6:39 PM, gill.saqib <[hidden email]> wrote:
Hi Guys,

I am new bee to mono development, i need some help with iphone camera
integration.

I want to capture image from iphone camera and save the image in to mono
project folder not into photo album.

Thanks!

Regards,
Gill

--
View this message in context: http://monotouch.2284126.n4.nabble.com/How-to-save-Image-from-Iphone-Camera-to-project-directory-other-than-photo-album-Mono-touch-tp4589225p4589225.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch



_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to save Image from Iphone Camera to project directory other than photo album - Mono touch

gill.saqib
Thanks Craig, that's worked :)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to save Image from Iphone Camera to project directory other than photo album - Mono touch

proindigo
In reply to this post by Craig Dunn
Has anybody here noticed that the link to sample code download in the link
http://docs.xamarin.com/ios/recipes/Media/Video_and_Photos/Save_Photo_to_Album_with_Metadata
doesn't work and instead gives you an image? Or is it happening only to me?

What's the matter?

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to save Image from Iphone Camera to project directory other than photo album - Mono touch

arvindhindyar
In reply to this post by Craig Dunn
Hi Craig,
Please help me to get the saved imaged from Environment.SpecialFolder.Personal,
I want to use the image picker controller to pick an image to upload. what are the possiblities ???
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to save Image from Iphone Camera to project directory other than photo album - Mono touch

Nic Wise
You can't use the built in picker for your own folder - you will need
to write one from scratch.

Or, save the images from SpecialFolder.Personal into the photo
library, and allow the user to pick from there.



On 21 June 2013 15:14, arvindhindyar <[hidden email]> wrote:

> Hi Craig,
> Please help me to get the saved imaged from
> Environment.SpecialFolder.Personal,
> I want to use the image picker controller to pick an image to upload. what
> are the possiblities ???
>
>
>
> --
> View this message in context: http://monotouch.2284126.n4.nabble.com/How-to-save-Image-from-Iphone-Camera-to-project-directory-other-than-photo-album-Mono-touch-tp4589225p4658364.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/monotouch



--
Nic Wise
t.  +44 7788 592 806 | @fastchicken
b. http://www.fastchicken.co.nz/
_______________________________________________
MonoTouch mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/monotouch
Loading...