문제

I have embeded a user image in message body of MFMailComposeSheet in my iPhone app.

NSMutableString *messageBody = [[[NSMutableString alloc] initWithString:@"<html><body>"] retain];

NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(capturedProfileImage)];
NSString *base64String = [self base64forData:imageData];

[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",textMessage];
[messageBody appendFormat:@"<p>REGARDS</p>"];
[messageBody appendFormat:@"<p><b><img src='data:image/png;base64,%@'>  </b></p>", base64String];
[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",userName];
[messageBody appendFormat:@"<p>&nbsp;&nbsp;&nbsp;&nbsp; %@.</p>",userPhone];
[messageBody appendFormat:@"</body></html>"];

Require format is like as follows:

Sample screen

But the embedded image displayed in its actual size, and I need to display in 57x57 pixels. How do I fix the width and height of the image as 57x57?

도움이 되었습니까?

해결책

Fixed:

[messageBody appendFormat:@"<p><b><img src='data:image/png;base64  , %@'  style='width:57px; height=57px;'>  </b></p>", base64String];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top