I need add watermark to the photo by special way. I know how to do it, but I dunno how to do it the same way as in article http://www.photoshopessentials.com/photo-effects/c
If you create your copyright image so that it is translucent and has a transparent background like this (using Paint.NET):
you can create a TextureBrush
from it and use that to draw the copyright over the original image:
private void button2_Click(object sender, EventArgs e)
{
using (Image image = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"))
using (Image watermarkImage = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\watermark.png"))
using (Graphics imageGraphics = Graphics.FromImage(image))
using (Brush watermarkBrush = new TextureBrush(watermarkImage))
{
imageGraphics.FillRectangle(watermarkBrush, new Rectangle(new Point(0, 0), image.Size));
image.Save(@"C:\Users\Public\Pictures\Sample Pictures\Desert_watermark.jpg");
}
}
which produces this result: