Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This article describes how to turn your IIS Web Se...
Author:
Anton Deve
Website:
http://www.tonec.com/download4/wap.html
Submitted:
6/27/2002
Version:
ASP
Compatibility:
ASP
Category:
ASP
Views:
15768
This article describes how to turn your IIS Web Server to a WAP server that creates WBMP images on the fly. The article consists of 3 parts. First part describes how to configure IIS. Second part tells you about how to create WBMP images on the fly. Third part shows how you can convert existing images to WBMP that can be displayed by a WAP enabled phone.
Declarations:
'none
Code:
<% LANGUAGE="VBSCRIPT" %> <% 'Set image format Dim ImageType 'ImageType = 0 ' PNG 'ImageType = 1 ' Jpeg 'By default set WBMP format ImageType = 2' WBMP 'Request from querystring variable ' this parameter specifies the format of generated images rqs = Request.QueryString("type") if rqs <> "" then if isNumeric(rqs) then if ((rqs >=0) and (rqs<3)) then ImageType = rqs end if end if ' 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. Select case ImageType case 0 Response.ContentType = "image/png" case 1 Response.ContentType = "image/jpeg" case 2 Response.ContentType = "image/vnd.wap.wbmp" case else Response.ContentType = "image/png" End Select ' Declare object variable Dim im Dim a ' Create ActiveImage object Set im = CreateObject("ActiveImage.Images.1") ' Create image with 100x100 dimensions im.CreateImage 100,100 ' Set image type im.SetImageType ImageType ' Set white color to fill the image im.SetColor 255, 255,255 im.Fill 0,0 ' Draw black rectangle and draw text im.SetColor 0, 0, 0 im.DrawRectangle 1,1,99,15 im.DrawText 2,1, "ActiveImage WBMP" ' Draw chart dynamically Dim d(5) Randomize d(1) = CInt(RND*50) d(2) = CInt(RND*50) d(3) = CInt(RND*50) d(4) = CInt(RND*50) d(5) = CInt(RND*50) h = 8 y = 10 im.SetFont 3 For i = 1 to 5 y = y + h im.DrawFilledRectangle 1,y+1,d(i),y+h-1 im.DrawText d(i)+4,y+1, d(i) next ' If image is OK, set quality Jpeg ' to 100 percents im.SetJpegQuality 100 ' Save the image to the variable a = im.WriteToVariable ' Send the image to the output stream response.BinaryWrite a ' Free memory retval = im.DestroyImage Set im = Nothing Response.End %>
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement