title: Merge an image, a background and Text into a single image
body: <p>I found this code here:</p>
  
  <pre><code>Private _BackgroundColours As New List(Of String)() From { _
      "339966", _
      "3366CC", _
      "CC33FF", _
      "FF5050" _
  }
  
  Public Function GenerateRactangle(firstName As String, lastName As String) As MemoryStream
      Dim imgSize() As Integer = {800, 800}
      Dim avatarString As String = String.Format("{0}{1}", firstName(0), lastName(0)).ToUpper()
      Dim bgColour = _BackgroundColours(New Random().[Next](0, _BackgroundColours.Count - 1))
      Dim bmp As Bitmap = New Bitmap(imgSize(0), imgSize(1))
      Dim sf As StringFormat = New StringFormat()
      Dim ms As MemoryStream = New MemoryStream()
      Dim font As Font = New Font("Arial", 172, FontStyle.Bold, GraphicsUnit.Pixel)
      Dim graphics__1 As Graphics = Nothing
  
      sf.Alignment = StringAlignment.Center
      sf.LineAlignment = StringAlignment.Center
  
      graphics__1 = Graphics.FromImage(bmp)
      graphics__1.Clear(DirectCast(New ColorConverter().ConvertFromString("#" + bgColour), Color))
      graphics__1.SmoothingMode = SmoothingMode.AntiAlias
      graphics__1.TextRenderingHint = TextRenderingHint.AntiAliasGridFit
      graphics__1.DrawString(avatarString, font, New SolidBrush(Color.WhiteSmoke), New RectangleF(0, 0, imgSize(0), imgSize(1)), sf)
      graphics__1.Flush()
      bmp.Save(ms, ImageFormat.Png)
  
      Return ms
  End Function
  </code></pre>
  
  <p>On <a href="https://stackoverflow.com/questions/33120224/set-default-user-profile-picture-to-an-image-of-their-initials">stackoverflow</a> and it works great. However, I am in need of using a transparent PNG image in the background with the color changing background color.</p>
  
  <p>What it currently looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/fl9PP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fl9PP.png" alt="enter image description here"></a></p>
  
  <p>What I am looking for it to look like:</p>
  
  <p><a href="https://i.stack.imgur.com/xyYKh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xyYKh.jpg" alt="enter image description here"></a></p>
  
  <p>With the PNG image being this that was added:</p>
  
  <p><a href="https://i.stack.imgur.com/k2fOF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k2fOF.png" alt="enter image description here"></a></p>
  
  <p>I am hoping someone with more knowledge about the graphics calls can let me know how to go about doing this.</p>