Mail Composer - attach screenshot

Edit - I know some of us are emailing screenshots via their app. Below is the portion of Apple’s mailcomposer that attaches the file in the mainBundle. To those that have this working, mind sharing your solution? I’m sure it would help many. Thanks!

Note - I have grabScreen, saveImage working fine.

Here’s my code for the mail composer:

  
// Attach an image to the email  
	NSString *path = [[NSBundle mainBundle] pathForResource:@"saved" ofType:@"png"];  
    NSData *myData = [NSData dataWithContentsOfFile:path];  
	[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"saved"];  

try setting your data path

  
ofSetDataPathRoot("./");  

Same results as before… Are you now able to take a screenshot and email? If so, mind sharing all the pieces?

Hi Hi,

how about this ?

  
img.saveImage( ofxiPhoneGetDocumentsDirectory() + "saved.png" );   

I can save, but the file is just black image.
do I need some initialize for img ??

Hello - I’ve updated this thread to reflect what my issue actually is. Saving on my part is fine. It didn’t appear to be working until I tested further.