Forums

This topic is locked

Watermark with Picture Processor?

Posted 02 Feb 2004 19:44:23
1
has voted
02 Feb 2004 19:44:23 Mark Bieganek posted:
I know that the ComObjects.NET Picture Processor component that is included with the Smart Image Processor extension has the ability inherit within it to place watermarks on uploaded images. I have looked on the web as to how to best implement this, but I don't want to interfere with the code that is running to resize my images.

Here is the code I found, can someone help me figure out how to integrate it with the Smart Image Processor and Pure ASP Upload extensions? Thanks!

------>Start code snip <------
'Drawing watermark over image
Dim objPictureProcessor, intX ,intY
Set objPictureProcessor = Server.CreateObject("COMobjects.NET.PictureProcessor"
'Use for trial version of Picture Processor
'Set objPictureProcessor = Server.CreateObject("COMobjects.NET.PictureProcessor.Trial"

objPictureProcessor.LoadFromFile "C:\SomePicture.jpg"
'black color
objPictureProcessor.FontColor = 0
objPictureProcessor.FontEscapement = 0
objPictureProcessor.FontOrientation = 0
objPictureProcessor.FontHeight = 24
objPictureProcessor.FontWidth = 16
objPictureProcessor.FontWeight = 800
objPictureProcessor.FontItalicOn = True
objPictureProcessor.FontStrikeOutOn = False
objPictureProcessor.FontUnderlineOn = False
objPictureProcessor.FontName = "Arial"
'Center Alignment
objPictureProcessor.FontAlignment = 0

'calculation of x,y output coordinates
intX = 2
intY = objPictureProcessor.Height-objPictureProcessor.FontHeight
'Draw text with opacity equals 100
objPictureProcessor.TextOut "www.comobjects.net", intX, intY, 100

objPictureProcessor.SaveToFileAsJpeg "C:\SomePictureWithMyText.jpg"
-------> End Code Snip <------

Reply to this topic