Stream stream = new MemoryStream(pict6); // Stopwatch stopwatch = new Stopwatch(); // stopwatch.Start(); string path = context.Server.MapPath("~/Image/watermark_with_whiteoutline_Stroke2with35%_1200X950.png"); Bitmap _watermarkImage = new Bitmap(path); // watermark image Bitmap _baseImage = new Bitmap(stream); Bitmap bmpToSave = new Bitmap(1200, 950); using (Graphics g = Graphics.FromImage(bmpToSave)) { g.DrawImage(_baseImage, 0, 0, 1200, 950); g.Save(); g.Dispose(); } //Draw the watermark offset 10 pixels from the left and 10 pixels from the top of the base image. Graphics canvas = Graphics.FromImage(bmpToSave); canvas.DrawImage(_watermarkImage, new Point(50, 50)); canvas.Save(); bmpToSave.Save(context.Response.OutputStream, ImageFormat.Jpeg); //clean up bmpToSave.Dispose(); canvas.Dispose(); _baseImage.Dispose();
Convert.ToBase64String
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)