i add watermark on taken image, and the message is successfully sent to email, but only the image from camera, not with image watermark.
here is my function
function demo(inputImages) {
//var inputImages = ['img/10.gif', 'http://i.imgur.com/3OfclQY.jpg'];
jQuery_1_7_1.each(inputImages, function (i, v) {
jQuery_1_7_1('<img>', {
src: v
}).watermark({
done: function (imgURL) {
jQuery_1_7_1('#content').append('<p><img src="' + imgURL + '"></p>');
}
});
});
jQuery_1_7_1('.watermark2').watermark({
path: '/watermark/Images/watermark.png',
margin: 20,
gravity: 'nw',
opacity: 0.5
});
}
and i call this function here:
function base64_toimage() {
jQuery_1_7_1('#image').attr("src", "data:image/png;base64," + jQuery_1_7_1.scriptcam.getFrameAsBase64());
jQuery_1_7_1('#UploadBase64').val(jQuery_1_7_1.scriptcam.getFrameAsBase64());
var new_src = jQuery_1_7_1("#image").attr('src', "data:image/png;base64,");
demo(new_src);
return false;
}
what i need to add in the controller to take the watermark with image together
public async Task<ActionResult> Contact(EmailFormModel model)
{
if (ModelState.IsValid)
{
var body = "<p>Email From: {0} ({1})</p><p>Message:</p><p>{2}</p>";
var message = new MailMessage();
message.To.Add(model.FromEmail);
message.Subject = "Your email subject";
message.Body = string.Format(body, model.FromName, model.FromEmail, model.Message);
message.IsBodyHtml = true;
string base64 = model.newImageData;
byte[] imagebytes = Convert.FromBase64String(base64);
message.Attachments.Add(new Attachment(new MemoryStream(imagebytes), "Image1.jpg", "image/jpeg"));
using (var smtp = new SmtpClient())
{
await smtp.SendMailAsync(message);
return RedirectToAction("Sent");
}
}
return View(model);
}