Print Page | Close Window

HELP ME ABOUT ASPJPEG components Watermark

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26365
Printed Date: 03 April 2026 at 4:59am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: HELP ME ABOUT ASPJPEG components Watermark
Posted By: Chirs
Subject: HELP ME ABOUT ASPJPEG components Watermark
Date Posted: 07 October 2008 at 9:31am

<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="RTE_configuration/RTE_setup.asp" -->
<!--#include file="functions/functions_upload.asp" -->
<!--#include file="functions/functions_date_time_format.asp" -->
<%
'****************************************************************************************
'**  Copyright Notice   
'**
'**  Web Wiz Forums
'**  http://www.webwizforums.com - http://www.webwizforums.com
'**                                                             
'**  Copyright ?001-2007 Web Wiz. All Rights Reserved.  
'** 
'**  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'** 
'**  IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE
'**  THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'**  AND DERIVATIVE WORKS IMMEDIATELY.
'** 
'**  If you have not received a copy of the license with this work then a copy of the latest
'**  license contract can be found at:-
'**
'**  http://www.webwiz.net/license - http://www.webwiz.net/license
'**
'**  For more information about this software and for licensing information please contact
'**  'Web Wiz' at the address and website below:-
'**
'**  Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'**  http://www.webwiz.net - http://www.webwiz.net
'**
'**  Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************

 

'*************************** SOFTWARE AND CODE MODIFICATIONS ****************************
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE 
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************

 


'Set the timeout of the page
Server.ScriptTimeout =  1000


'Set the response buffer to true as we maybe redirecting
Response.Buffer = True

 

'Intiliase variables
blnExtensionOK = True
strUploadFilePath = strUploadFilePath


'read in the forum ID and message box type
intForumID = CInt(getSessionItem("FID"))


'Check the user is welcome in this forum
Call forumPermissions(intForumID, intGroupID)


'If the user is user is using a banned IP redirect to an error page
If bannedIP() OR blnBanned OR blnImageUpload = false OR blnRead = false OR (blnPost = false AND blnReply = false) Then
 
 'Clean up
 Call closeDatabase()

 'Redirect
 Response.Redirect("insufficient_permission.asp" & strQsSID1)
End If

 


'Read in the file types that can be uploaded
If blnImageUpload AND blnRead AND (blnPost OR blnReply) Then
 
 'If this is a post back then upload the image
 If Request.QueryString("PB") = "Y" Then
 
 
  'Call upoload file function
  strImageName = fileUpload("image")
  
  
  Dim Jpeg
  ' 建立实例
  Set Jpeg = Server.CreateObject("Persits.Jpeg")
  ' 打开目标图片
  Jpeg.Open Server.MapPath(strUploadFilePath&"/"& strImageName )
  
  ' 添加文字水印
  Jpeg.Canvas.Font.Color = &HFF0000' 红色
  Jpeg.Canvas.Font.Family = "宋体"
  Jpeg.Canvas.Font.Bold = True
  Jpeg.Canvas.Print 10, 10, "123456"
  ' 打印坐标x 打印坐标y 需要打印的字符
  '以下是对图片进行边框处理
  Jpeg.Canvas.Pen.Color = &H000000'' black 颜色
  Jpeg.Canvas.Pen.Width = 2 '画笔宽度
  Jpeg.Canvas.Brush.Solid = False '是否加粗处理
  Jpeg.Canvas.Bar 1, 1, Jpeg.Width, Jpeg.Height
  '起始X坐标 起始Y坐标 输入长度 输入高度

 
  ' 保存文件
  Jpeg.Open Server.MapPath(strUploadFilePath&"/"& strImageName )
  
  ' 注销对象
  Set Jpeg = Nothing  
   
  

  

 
 End If
End If

 

 

 

 

'Reset Server Objects
Call closeDatabase()

%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title>Image Upload</title>

<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write(vbCrLf & "<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Rich Text Editor ver. " & strRTEversion & "" & _
vbCrLf & "Info: http://www.richtexteditor.org - http://www.richtexteditor.org " & _
vbCrLf & "Copyright: (C)2001-2007 Web Wiz. All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>

<script  language="JavaScript">
<%
'If the image has been saved then place it in the post
If lngErrorFileSize = 0 AND blnExtensionOK = True AND blnFileSpaceExceeded = False AND blnFileExists = False AND strImageName <> "" Then
%>
 window.opener.document.getElementById('message').focus();
 window.opener.document.getElementById('message').value += '

';
 /*window.opener.document.getElementById('uploads').value += '<% = strImageName %>;';*/
 window.close();
 
<%
End If
%>
</script>
<style type="text/css">
<!--
html, body {
  background: ButtonFace;
  color: ButtonText;
  font: font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 12px;
  margin: 2px;
  padding: 4px;
}
.text {
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 12px;
 color: #000000;
}
.error {
 font-family: Verdana, Arial, Helvetica, sans-serif;
 font-size: 12px;
 color: #FF0000;
}
legend {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 12px;
 color: #0000FF;
}
-->
</style>
</head>
<body OnLoad="self.focus(); document.forms.frmImageUp.Submit.disabled=true;">
<%

'If the user is allowed to upload then show them the form
If blnImageUpload AND blnRead AND (blnPost OR blnReply) Then 

%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="0">
 <form action="non_RTE_upload_images.asp?PB=Y<% = strQsSID2 %>" method="post" enctype="multipart




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net