Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

watermark image is being resized.

$
0
0
In the below code I would like to make sure that the water mark image does not get resize with the cropped image. I would like the water mark image to remain it;s original size. Any help would be appreciated.

// Thumbnail-size image
Byte[] byteBLOBData = new Byte[0];

byteBLOBData = (byte[])dReader["p_Image"];

ImageExtension = dReader["p_Type"].ToString();

MemoryStream stmBLOBData = new MemoryStream(byteBLOBData);

stmBLOBData.Write(byteBLOBData, 0, byteBLOBData.Length);
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(stmBLOBData, false, false);

//define a string of text to use as the Copyright message
string Copyright = "Copyright © 2011 - OmegaLove.com";
//add fading to logo image using TextureBrush
System.Drawing.Image waterMarkimage = System.Drawing.Image.FromFile (
(System.Web.HttpContext.Current.Server.MapPath("~/Images/Watermark/watermark.jpg")));
System.Drawing.Image wm = Watermark.SetOpacity(waterMarkimage, 150);
System.Drawing.Image cropImage = ImageHandler.ImageCrop(returnImage, 100, 160,
ImageHandler.AnchorPosition.Bottom);
Graphics g = System.Drawing.Graphics.FromImage(cropImage);
Point point = new Point(cropImage.Width / 3, cropImage.Height / 2);
g.DrawImage(wm, point);


// Set the page's content type to JPEG files
// and clear all response headers.
context.Response.ContentType = "image/jpeg";
context.Response.Clear();

// Buffer response so that page is sent
// after processing is complete.
context.Response.BufferOutput = true;

// Save the bitmap to the response stream and
// convert it to JPEG format.
cropImage.Save(context.Response.OutputStream, ImageFormat.Jpeg);
waterMarkimage.Dispose();
wm.Dispose();
g.Dispose();
// Release memory.
cropImage.Dispose();
// Send the output to the client.
context.Response.Flush(); .

Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>