Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp.net mvc 4 merging two images
    text
    copied!<p>I have a View where i am showing list of Images in Slider every thing is done in but want to code when user select two images the Controller should merge images with each other and also implement some text on both images.well is it possible in Jquery that it copy both divs and convert them to image and send to controller well.</p> <p>any example C# Jquery Please let me know </p> <pre><code> [HttpPost] public ActionResult Index(HttpPostedFileBase Imageone, HttpPostedFileBase Imagetwo) { return View(); } public static System.IO.MemoryStream CombineImages(byte[] imageBytes1, byte[] imageBytes2) { if ((imageBytes1 == null || imageBytes1.Length == 0) || (imageBytes2 == null || imageBytes2.Length == 0)) return null; //convert bytes to Image var image1 = System.Drawing.Image.FromStream(new System.IO.MemoryStream(imageBytes1)); var image2 = System.Drawing.Image.FromStream(new System.IO.MemoryStream(imageBytes2)); //create the Bitmap object var bitmap = new System.Drawing.Bitmap(image1.Width, image1.Height, PixelFormat.Format32bppPArgb); //create the Graphics object var g = System.Drawing.Graphics.FromImage(bitmap); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; g.DrawImage(image1, 0, 0); g.DrawImage(image2, 0, 0); var ms = new System.IO.MemoryStream(bitmap.Width * bitmap.Height); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); return ms; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload