A program for dynamically generating wbmp pictures by ASP

Source: Internet
Author: User
Tags chr
program | Dynamic ASP dynamically generate Wbmp picture program
(ASP2001)
<%@ Language=vbscript%>
<%

' Function 1:
' Converts a string into a binary
Function Stob (VARSTR)
Str2bin = ""
For i = 1 to Len (VARSTR)
varchar = Mid (VARSTR, I, 1)
Str2bin = Str2bin & ChrB (AscB (varchar))
Next
Stob = Str2bin
End Function

' Function 2:
' "&h" in front of every two characters is hexadecimal, then "&h??" Add to "Chr ()" Inside
' What is the specific function, I also can not tell, anyway is necessary

Function SS (VARSTR)
BB = ""
For i = 1 to Len (VARSTR)/2
varchar = "&h" & Mid (Varstr, 2*i-1, 2)
BB=BB & chr (varchar)
Next
SS = BB
End Function

Img= " 00001414faf5f0fb6df0fbadf0fbdd801bfc70e71fe07ce7d0bbfbd0dbfbb0d7fd70b7fdb077f5d0fbebe0fbdbf01ce780c71c70f7fdf0f7bff0f65df 0f5edf00 "
' The meaning of this string refers to my previous post
' Of course, it can be automatically generated by the program based on data this string, if you understand the meaning of this string and have enough patience, think about it, generate a 100x100
Picture, to be composed of 1250 characters similar to "F0"!

Response.contenttype= "Image/vnd.wap.wbmp"
Response.BinaryWrite Stob (SS (IMG))

' Try it, it seems not very much like the sun, simple how to say is the pattern of the sun, perhaps his ability to draw is worse:%>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.