Click here to Skip to main content
15,847,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a watermark that needs to be less transparent. What should I do the below code:
Any help would be great.
// 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);
System.Drawing.Image cropImage = ImageHandler.ImageCrop(returnImage, 100, 160, ImageHandler.AnchorPosition.Bottom);

//define a string of text to use as the Copyright message
//string Copyright = "Copyright © 2011 -";
//add fading to logo image  using TextureBrush
System.Drawing.Image waterMarkimage = System.Drawing.Image.FromFile (

Color color = System.Drawing.Color.FromArgb(50, 0, 0, 0);

Graphics opacity = System.Drawing.Graphics.FromImage(waterMarkimage);

Rectangle imageRect = new Rectangle(0, 0, waterMarkimage.Width,  waterMarkimage.Height);
Brush brush = new TextureBrush(waterMarkimage, imageRect);
opacity.FillRectangle(brush, imageRect);
Graphics g = System.Drawing.Graphics.FromImage(cropImage);
Point point = new Point(cropImage.Width / 3, cropImage.Height / 2);
g.DrawImage(waterMarkimage, point);
Updated 15-Feb-11 10:27am
Manfred Rudolf Bihy 15-Feb-11 15:31pm    
Edit: Added pre tags.
William Winner 15-Feb-11 15:46pm    
which is it? more or less transparent? Your post title says more transparent while the post text says less transparent.
macupryk 15-Feb-11 18:26pm    
more transparent. Sorry for the misconception.

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900