The current solution is i need to save image and then load attachment with file is it possible to load from UIImageView directly? any idea?
A:
Attachment is set as a NSData object and you can get it from UIImage object directly using one of the following functions:
UIImageJPEGRepresentation
- for image in JPEG formatUIImagePNGRepresentation
- for image in PNG format
Vladimir
2010-09-17 10:33:20
if i want to load from uiimaveview is it possible? i dont know solution for load uiimageview to uiimage.
RAGOpoR
2010-09-17 10:43:55
yes, get an image from imageview and pass it to functions I mention to get image data. SOmething like this: NSData* data = UIImagePNGRepresentation(imageView.image);
Vladimir
2010-09-17 10:48:21
thank you Vladimir.
RAGOpoR
2010-09-17 10:49:24
[mail addAttachmentData:data mimeType:@"" fileName:@""]; in mimeType and fileName what should i insert to in because i grab from UIImageView i dont know the mimeType and not have filename
RAGOpoR
2010-09-17 10:50:28
mimetype - image/png or image/jpeg depending on what format you use. For file name you can set arbitrary name - I suppose user will see it as an attachment name when he receives email
Vladimir
2010-09-17 11:12:52
that correct! thanks Vladimir
RAGOpoR
2010-09-17 11:20:55