Public Sub AddWatermark(filename As String, watermarkText As String, outputStream As Stream)
Dim bitmap As Bitmap = Bitmap.FromFile(filename)
Dim font As New Font("Arial", 20, FontStyle.Bold, GraphicsUnit.Pixel)
Dim color As Color = Color.FromArgb(10, 0, 0, 0) 'Adds a black watermark with a low alpha value (almost transparent).
Dim atPoint As New Point(100, 100) 'The pixel point to draw the watermark at (this example puts it at 100, 100 (x, y)).
Dim brush As New SolidBrush(color)
Dim graphics As Graphics = Nothing
graphics = Graphics.FromImage(bitmap)
graphics.DrawString([text], font, brush, atPoint)
graphics.Dispose()
bitmap.Save(outputStream)
End Sub