ASP image counters without image components

Source: Internet
Author: User
Tags 0xc0 sort
Counter a few days ago saw Netnice and Qzsage June's post, quite enlightening, so began to make up an image counter, this image counter does not use image components, also not used to put together a few pictures, but used the *.XBM picture format. This format may only be displayed under Windows+ie.
The specific idea is this:
The picture is expressed in the form of a lattice, such as 2:

00111100 0011 is 3 1100 is C namely 0x3c
01100110 0110 is 6 0110 for 6 0x66
01100000 ..... The 0x represents a hexadecimal number.
01100000 and so forth
00110000 This is a binary number of lattice, of which 1 to show a black dot, 0 does not show
00011000 is an inverse look at the 2
00001100 the remaining digits can be sorted from the array matrix and binary to hexadecimal numbers
00000110 disadvantage is that only black and white are two colors
00000110 display is white background black word, to show black background, to take the opposite of the word on the line
01111110

Here are 0-9 of the numbers I drew.

Num.asp

<%
Dim A (10,10)

A (0,1) = "0x3c" ' number 0
A (0,2) = "0x66"
A (0,3) = "0xc3"
A (0,4) = "0xc3"
A (0,5) = "0xc3"
A (0,6) = "0xc3"
A (0,7) = "0xc3"
A (0,8) = "0xc3"
A (0,9) = "0x66"
A (0,10) = "0x3c"

A (1,1) = "0x18" ' number 1
A (1,2) = "0x1c"
A (1,3) = "0x18"
A (1,4) = "0x18"
A (1,5) = "0x18"
A (1,6) = "0x18"
A (1,7) = "0x18"
A (1,8) = "0x18"
A (1,9) = "0x18"
A (0,10) = "0x7e"


A (2,1) = "0x3c" ' Number 2
A (2,2) = "0x66"
A (2,3) = "0x60"
A (2,4) = "0x60"
A (2,5) = "0x30"
A (2,6) = "0x18"
A (2,7) = "0x0c"
A (2,8) = "0x06"
A (2,9) = "0x06"
A (2,10) = "0x7e"

A (3,1) = "0x3c" ' Number 3
A (3,2) = "0x66"
A (3,3) = "0xc0"
A (3,4) = "0x60"
A (3,5) = "0x1c"
A (3,6) = "0x60"
A (3,7) = "0xc0"
A (3,8) = "0xc0"
A (3,9) = "0x66"
A (3,10) = "0x38"

A (4,1) = "0x38" ' Number 4
A (4,2) = "0x3c"
A (4,3) = "0x36"
A (4,4) = "0x33"
A (4,5) = "0x33"
A (4,6) = "0x33"
A (4,7) = "0xFF"
A (4,8) = "0x30"
A (4,9) = "0x30"
A (4,10) = "0xFE"

A (5,1) = "0xFE" ' number 5
A (5,2) = "0xFE"
A (5,3) = "0x06"
A (5,4) = "0x06"
A (5,5) = "0x3e"
A (5,6) = "0x60"
A (5,7) = "0xc0"
A (5,8) = "0xc3"
A (5,9) = "0x66"
A (5,10) = "0x3c"

A (6,1) = "0x60" ' number 6
A (6,2) = "0x30"
A (6,3) = "0x18"
A (6,4) = "0x0c"
A (6,5) = "0x3e"
A (6,6) = "0x63"
A (6,7) = "0xc3"
A (6,8) = "0xc3"
A (6,9) = "0x66"
A (6,10) = "0x3c"

A (7,1) = "0xFF" ' Number 7
A (7,2) = "0xc0"
A (7,3) = "0x60"
A (7,4) = "0x30"
A (7,5) = "0x18"
A (7,6) = "0x18"
A (7,7) = "0x18"
A (7,8) = "0x18"
A (7,9) = "0x18"
A (7,10) = "0x18"

A (8,1) = "0x3c" ' number 8
A (8,2) = "0x66"
A (8,3) = "0xc3"
A (8,4) = "0x66"
A (8,5) = "0x3c"
A (8,6) = "0x66"
A (8,7) = "0xc3"
A (8,8) = "0xc3"
A (8,9) = "0x66"
A (8,10) = "0x3c"

A (9,1) = "0x3c" ' Number 9
A (9,2) = "0x66"
A (9,3) = "0xc3"
A (9,4) = "0xc3"
A (9,5) = "0x66"
A (9,6) = "0x3c"
A (9,7) = "0x18"
A (9,8) = "0x0c"
A (9,9) = "0x06"
A (9,10) = "0x03"

%>

The methods displayed are:

1. First outgoing MIME:
Response.ContentType = "Image/x-xbitmap"
2. Another C + + source program, such as Display 2:
#define COUNTER_WIDTH 8
#define Counter_height 10
static unsigned char counter_bits[] = {
0x3c,0x66,0x60,0x60,0x30,0x18,0x0c,0x06,0x06,0x7e
};
This will show up to 2 of a 8*10 pixel in the browser.

To display two or more digits, change the width of the value (must be an integer multiple of the image lattice width), and sort the values in the count_bits[] array as follows:
Like Show 12
A (1,1), A (2,1), A (1,2), A (2,2) ... a (1,10), A (2,10)
The following are examples of specific counters:

Count.asp

<!--#include file= "num.asp"-->
<%
Dim Image
Dim Width, Height
Dim num
Dim digtal
Dim Length
Dim sort
Length = 10 ' Custom counter Lengths

Redim Sort (Length)


Value of num = 62275 ' counter
Digital = ""
For I = 1 to Length-len (num) ' supplement 0
Digital = Digital



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.