def add_watermark(identifier, path, xpos, ypos)
			if !File.file?(path)
				raise "File: " + path + " does not exist"
			end
			sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(identifier)+"|"+GrabzIt::Utility.nil_int_check(xpos)+
			"|"+GrabzIt::Utility.nil_int_check(ypos))

			boundary = '--------------------------'+Time.now.to_f.to_s

			url = @protocol + "://grabz.it/services/addwatermark.ashx"
			uri = URI.parse(url)

			file = File.open(path, "rb")
			data = file.read

			post_body = Array.new
			post_body << "\r\n--"+boundary+"\r\n"
			post_body << "Content-Disposition: form-data; name=\"watermark\"; filename=\""+File.basename(path)+"\"\r\nContent-Type: image/jpeg\r\n\r\n"
			post_body << data
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"key\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(@applicationKey)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"identifier\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(identifier)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"xpos\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(xpos)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"ypos\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(ypos)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"sig\"\r\n\r\n"
			post_body << sig
			post_body << "\r\n--"+boundary+"--\r\n"

			request = Net::HTTP::Post.new(url)
			request.content_type = "multipart/form-data, boundary="+boundary
			request.body = post_body.join
			
			caller = Net::HTTP.new(uri.host, uri.port)
			caller.use_ssl = uri.scheme == 'https'
			response = caller.start {|http| http.request(request)}	
			
			response_check(response)
			
			return (get_result_value(response.body(), "Result") == TrueString)		
		end
def add_watermark(identifier, path, xpos, ypos)
			if !File.file?(path)
				raise "File: " + path + " does not exist"
			end
			sig = encode(GrabzIt::Utility.nil_check(@applicationSecret)+"|"+GrabzIt::Utility.nil_check(identifier)+"|"+GrabzIt::Utility.nil_int_check(xpos)+
			"|"+GrabzIt::Utility.nil_int_check(ypos))

			boundary = '--------------------------'+Time.now.to_f.to_s

			url = @protocol + "://grabz.it/services/addwatermark.ashx"
			uri = URI.parse(url)

			file = File.open(path, "rb")
			data = file.read

			post_body = Array.new
			post_body << "\r\n--"+boundary+"\r\n"
			post_body << "Content-Disposition: form-data; name=\"watermark\"; filename=\""+File.basename(path)+"\"\r\nContent-Type: image/jpeg\r\n\r\n"
			post_body << data
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"key\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(@applicationKey)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"identifier\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(identifier)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"xpos\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(xpos)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"ypos\"\r\n\r\n"
			post_body << GrabzIt::Utility.nil_check(ypos)
			post_body << "\r\n--"+boundary+"\r\n"

			post_body << "Content-Disposition: form-data; name=\"sig\"\r\n\r\n"
			post_body << sig
			post_body << "\r\n--"+boundary+"--\r\n"

			request = Net::HTTP::Post.new(url)
			request.content_type = "multipart/form-data, boundary="+boundary
			request.body = post_body.join
			
			caller = Net::HTTP.new(uri.host, uri.port)
			caller.use_ssl = uri.scheme == 'https'
			response = caller.start {|http| http.request(request)}	
			
			response_check(response)
			
			return (get_result_value(response.body(), "Result") == TrueString)		
		end
Add a new custom watermark

 @param identifier [String] the identifier you want to give the custom watermark. It is important that this identifier is unique.
 @param path [String] the absolute path of the watermark on your server. For instance C:/watermark/1.png
 @param xpos [Integer] the horizontal position you want the screenshot to appear at: Left = 0, Center = 1, Right = 2
 @param ypos [Integer] the vertical position you want the screenshot to appear at: Top = 0, Middle = 1, Bottom = 2
 @return [Boolean] returns true if the watermark was successfully set
 @raise [RuntimeError] if the GrabzIt service reports an error with the request it will be raised as a RuntimeError