| 1 |
<% |
| 2 |
' This code will show you how to make GRAY effect 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/gray.jpg" ) |
| 12 |
|
| 13 |
|
| 14 |
' Gray method: |
| 15 |
' 1 - Weight averaging method, default |
| 16 |
' 2 - Maximum method |
| 17 |
' 3 - Average method |
| 18 |
Dim grayMethod |
| 19 |
grayMethod = 1 |
| 20 |
|
| 21 |
' Processing gray effect |
| 22 |
oGraphic.Gray grayMethod |
| 23 |
|
| 24 |
Set oGraphic = Nothing |
| 25 |
%> |
| 26 |
|
| 27 |
<% |
| 28 |
' Show the contrastive effect |
| 29 |
Response.Write "<img src=""images/demo.jpg"" border=""0"">" |
| 30 |
Response.Write "<img src=""images/tmp/gray.jpg"" border=""0"">" |
| 31 |
%> |
| 32 |
|