| 1 |
<% |
| 2 |
' This code will show you how to draw WATER TEXT on the image. |
| 3 |
|
| 4 |
Dim oGraphic |
| 5 |
Set oGraphic = Server.CreateObject("PhotoSprite.Graphic") |
| 6 |
|
| 7 |
' Original image name |
| 8 |
oGraphic.SourceFile = Server.MapPath( "images/demo.jpg" ) |
| 9 |
|
| 10 |
' Destination image name, and can make the same as the original image name |
| 11 |
oGraphic.DestFile = Server.MapPath( "images/tmp/watertext.jpg" ) |
| 12 |
|
| 13 |
|
| 14 |
oGraphic.FontFamily = "Arial" |
| 15 |
oGraphic.FontSize = 24 |
| 16 |
oGraphic.FontColor = "#FF0000" |
| 17 |
|
| 18 |
' Font weight: |
| 19 |
' Bold, Italic, Strikeout, Underline, Regular |
| 20 |
oGraphic.FontWeight = "Bold" |
| 21 |
|
| 22 |
' The transparency of the font color, which between 0 and 255 |
| 23 |
oGraphic.ColorAlpha = 255 |
| 24 |
|
| 25 |
' Text style |
| 26 |
' Default, Embossed, Chiseled, Outline |
| 27 |
oGraphic.TextStyle = "Embossed" |
| 28 |
|
| 29 |
' Align mode: |
| 30 |
' TopLeft, TopMid, TopRight, |
| 31 |
' MidLeft, Center, MidRight, |
| 32 |
' BottomLeft, BottomMid, BottomRight |
| 33 |
oGraphic.Align = "Center" |
| 34 |
|
| 35 |
' The X and Y coordinates of the text top left corner relative to the image |
| 36 |
' Note: |
| 37 |
' You must Set oGraphic.Align="TopLeft" |
| 38 |
' if you want to make the X, Y property valid. |
| 39 |
oGraphic.X = 0 |
| 40 |
oGraphic.Y = 0 |
| 41 |
|
| 42 |
|
| 43 |
' The text on the image |
| 44 |
Dim Text |
| 45 |
Text = "WWW.PHOTOSPRITE.NET" |
| 46 |
|
| 47 |
' The direction of showing the text on the image |
| 48 |
' True for vertical, False for horizontal |
| 49 |
Dim bIsHorz |
| 50 |
bIsHorz = True |
| 51 |
|
| 52 |
' Drawing the water text |
| 53 |
oGraphic.WaterText Text, bIsHorz |
| 54 |
|
| 55 |
Set oGraphic = Nothing |
| 56 |
%> |
| 57 |
|
| 58 |
<% |
| 59 |
' Show the contrastive effect |
| 60 |
Response.Write "<img src=""images/demo.jpg"" border=""0"">" |
| 61 |
Response.Write "<img src=""images/tmp/watertext.jpg"" border=""0"">" |
| 62 |
%> |
| 63 |
|