C# Watermark an image without overlapping
<p>What i'm trying to do is write a string to an image without overlapping the image.  So i want to watermark an image putting the watermark (string) at the bottom without actually affecting the image or stretching the image out.  I already know how to turn a string into an image, just having problems accomplishing the watermark.</p>

<p>1) Write string to Image on bottom right hand side<br>
2) don't stretch the original image<br>
3) extend the bitmap a little bit to include watermark?  </p>

<p>Does anybody have an example or an idea where to start?  If i don't make any sense i'll try to answer any questions.</p>

<p>Bitmap example:</p>

<p>here is the code I use to get the bitmap, how do I increase just the size by X like 20?  </p>

<pre><code>Bitmap original = (Bitmap)System.Drawing.Image.FromFile(coveted);
Bitmap newImage = new Bitmap(original);
</code></pre>

<p>And I guess the 2nd part is how do i determine the space that I need in order to write out a string to the very bottom right of the image, while fitting in the entire string...</p>

<p>@ROY:   This is the edit that i did.</p>

<p>This sorta works but the one watermark appears below the other.  if i could get them on the same line it would be perfect!</p>

<pre><code>private static Bitmap WatermarkImage2(Bitmap bmpOriginal, String waterMark2)
    {
        using (Graphics gfxOriginal = Graphics.FromImage(bmpOriginal))
        {
            using (Font fntWatermark = new Font("Arial", 24, FontStyle.Regular))
            {
                SizeF szWatermark = gfxOriginal.MeasureString(waterMark2, fntWatermark, int.MaxValue);
                Bitmap bmpWatermarked2 = new Bitmap(bmpOriginal.Width, bmpOriginal.Height + (int)(szWatermark.Height * 2));
                using (Graphics gfxWatermarked = Graphics.FromImage(bmpWatermarked2))
                {
                    gfxWatermarked.Clear(Color.White);
                    gfxWatermarked.DrawImageUnscaled(bmpOriginal, 0, 0);
                    gfxWatermarked.DrawString(waterMark2, fntWatermark, Brushes.Black, 0, (bmpOriginal.Height + szWatermark.Height) - (szWatermark.Height / 2));
                }
                return bmpWatermarked2;
            }
        }
    }
</code></pre>
