Images as Email Attachment

后端 未结 2 1131
一整个雨季
一整个雨季 2021-01-07 17:04

I want to build an application where i am able to attach an image with the email, open the image and set it as my wallpaper. I wanted to make it cross platform so can you te

2条回答
  •  感动是毒
    2021-01-07 18:04

    For iPhone sdk you attach image as :

    NSData *photoData = UIImageJPEGRepresentation([UIImage imageNamed:@"anImage.png"], 1);
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    [picker addAttachmentData:photoData mimeType:@"image/jpg" fileName:[NSString stringWithFormat:@"image001.png"]];
    

    For " open the image and set it as my wallpaper "

    It is not possible via code in iPhone. You have to use the Settings.app

提交回复
热议问题