Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Watermark an Image
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Watermark an Image

 Post Reply Post Reply
Author
seanlail View Drop Down
Groupie
Groupie


Joined: 01 December 2004
Location: United Kingdom
Status: Offline
Points: 101
Post Options Post Options   Thanks (0) Thanks(0)   Quote seanlail Quote  Post ReplyReply Direct Link To This Post Topic: Watermark an Image
    Posted: 19 October 2005 at 4:43pm

I've seen that with Lunix and php you can add a watermarked to an image based on a gif you have.

I dont understand it completely, so if my terminology is wrong, "oops".

My question is... is there a way to do this with ASP or ASP.Net???

Embarrassed
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2005 at 4:56pm
In asp.net it is very simple to do. Not so sure about asp. This is how I am using it on my gallery
 

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

 
To call it, just add something like this to your aspx file (assume the class is called MyImage):
 

Dim filename As String = "../images/someimage.jpg"

Dim image As New MyImage()
image.AddWatermark(filename, "Watermark Test", HttpResponse.OutputStream)


Edited by michael - 19 October 2005 at 4:58pm
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2005 at 8:21pm
I think you can merge two images with aspjpeg.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.