
Functional reference v1.1 for
FVS Watermarker ActiveX component
Introduction
This is the Functional reference guide for use with Fluid Vision Systems (FVS) Watermarking ActiveX component.
The FVS watermarker allows you to apply a transparent (physical) watermark and/or text to your image in order to protect from copyright and misuse. Click here for an example
There are also a few extra usefull functions, when having to manipulate images.
Terms used in this document
Watermark f ile - The image file of a graphic or logo you wish to apply as a watermark onto your source image, the use of these slightly change when using template files (see below)
Template/Mask
file - You
can add custom shaped watermarks to your
images. With just a watermark file you simply adjust the level of transparency across
the whole watermark image, and because it is a bitmap you will always see a
square image. Obviously logos etc. can be all types of shapes so to apply a
custom shape you use a template file which acts as a 'mask' between the main
image and the watermark image, whereby any area of black (RGB 255,255,255) is
not passed through.
The template
files black areas are not passed through to the main image, when the
watermark is applied. By adjusting the level of grey (for example RGB, 70,70,70) determines
the level of transparency when the watermark is applied to all non
black areas (the transparency level value will always be ignored when using a template
file).
Example trick
So for example with this watermark file
(which is simply the colour white, so that white text is generated):![]()
And this template file
(remember anything black does not get passed through ie RGB 255,255,255 as you
vary this the towards 0 on each colour
value you will get a different transparent effect), and both
the template file and watermark file are the same size):![]()
You get this
result when the above files are applied to the FVS watermarker:
This
use of the template file allows the user full flexibility in determining the
shape of the watermark, by changing the RGB levels and the colour bias of
the template file you can manipulate all aspects of the effects you create. To
create the template files it is recomended you use a photo editor package and
test them out using our watermarking utility Tranz
.
Function list
| ACTXWaterMark | ACTXLiveWatermark | ACTXImageXY | ACTXDirExist |
| ACTXMakeDir | ACTXCopyFile | ACTXDelFile | |
Assumptions
This API reference assumes you have downloaded and installed the Fluid Visions Systems Active X component.
You are familiar with the general use of ActiveX components from within development environments like ASP and VB.
To initialise the ActiveX component in ASP use the following syntax,
Set Pics = CreateObject("FVSWaterActxOBJ.WATERACTOBJ")
'Perform commands
Set Pics = nothing
Example VB code can be found in c:\program files\FVS Watermarker directory once installed.
Tips
Within ASP and its loose atitude to type definition, when passing variables to the functions below, it is a usefull idea to force type with the use of the cint and cstr functions when variables are passed.
Function Reference
ACTXWaterMark
|
Creates a watermarked image file based on various parameters passed to it. Remarks Currently only creates a watermark file as JPEG, all fields are required (pass empty string if not required). Parameters OrigFile (String) File for watermark to be applied to, (including full path) OutFile (String) Name of output file, (including full path) Watermarkfile (String) File to be applied as watermark file, (including full path) leave blank if only wishing to apply standard text watermark. Maskfile (String) File to be applied as watermark mask file, (including full path) mask file works as a method of cancelling out certain regions of the watermark file, see example above, leave blank if you only wish to use standard text watermark. Watermarktext (String) Standard ascii text to appear on image, there is no anti-aliasing or transparency effect. WaterTransparency (Integer) Level of transparency of applied Watermark image valid from 1 - 254 where 1 is the most transparent. positionX(Integer) The X position in pixels of the top left hand side of the Watermark image from the left hand side of the original file, a value -1 will automatically centre the image. positionY(Integer) The Y position in pixels of the top left hand side of the Watermark image from the top of the original file, a value -1 will automatically centre the image.
JpegOutputQuality (Integer) Jpeg Quality factor of resultant output file, values of 2-255, 2 being the best quality. TextColour (Integer) Colour of ascii text. TextHeight(Integer) Height in pixels of ascii text TextFont (Integer) Font name if applying ascii text to image Serial Number (String) When you register the control enter the serial code here to deactivate the software protection message Returns Text string of 'success' if ok or an error string displaying the problems found. Syntax
|
|
Exactly the same as function ACTXWatermark except that it returns the binary stream of the output jpeg file. This gives the usefull ability of being able of 'live' imaging on the web, see example here. Remarks To be used within ASP, usefull for generating inline <Img Src> images Parameters See ACTXWatermark Returns Returns a JPEG binary stream. Syntax ----------------------------Example ASP file called watermark.asp ------------------------- ' Clear out the existing HTTP header information Response.Expires = 0 Response.Buffer = TRUE Response.Clear ' Change the HTTP header to reflect that an image is being passed. Response.ContentType = "image/jpg" Set Pics = CreateObject("FVSActxOBJ.PICSACTOBJ") PicStream = Pics.ACTXLiveWatermark(cstr(infile),cstr(outfile),cstr(wfile),cstr(mfile),"",cint(transparency),-1,-1,85,"",20,"ARIAL","no","") Response.BinaryWrite PicStream Set Pics = nothing Response.End ----------------------------------------- ' You can then call the above .asp file from within a <IMG> tag from any other piece of HTML eg. <IMG SRC='"watermarker.asp" BORDER=0> |
|
Retrieve the image size for a selected image file. Remarks Parameters Filename (string) Full file path to the image file. Returns String containing details of image size in pixels of the form XXXX-YYYY, see example below on how to extract X and Y values Syntax res = Pics.ACTXImageXY(cstr(Filename)) x=mid(res,1,instr(1,res,"-")-1) y=mid(res,instr(1,res,"-")+1,len(res)) |
ACTXDirExist
|
Find out if a Directory exists in a given file system. Remarks Parameters Dirname(string) Full path to Directory you are testing. Returns Returns true or false. Syntax if Pics.ACTXDirExist("c:\temp\dirname")= true then ..... Found else ....Not Found end if |
|
Delete media and textual information from a collection. Remarks Parameters Dirname(string) Full path to Directory you wish to create. Returns Returns true or false. Syntax res= Pics.ACTXMakeDir("c:\temp\dirname") |
|
Copy a file from one loaction to the other. Remarks Parameters Filename1(string) Source file (fullpath) Filename2(string) Target file (Fullpath) Returns Returns true or false. Syntax res=Pics.ACTXCopyFile("c:\temp\sourcefile.jpg", "c:\temp\copyedfile.jpg") |
|
Deletes a file. Remarks Parameters Filename(string) File to delete (fullpath) Returns Returns true or false. Syntax res= Pics.ACTXDelFile("c:\temp\sourcefile.jpg") |