Fadshop.net
A website for better software and better life in Internet!
   MY WEB

   Chinese URLs

   Greeting Creator

   Input Tips Everyday

   Source Code
Java Applet Games
Visit webpage in VC
M3U Music List Editor
Input Tips everyday
Combox in HTML
Self-made Screen Saver
Model of Neural Network
Display Chinese Characters
Mouse in Maze, a classic game in math
Serial Port Communication

Source Code: Display Chinese Characters in English Operation System.
 

How to use Chinese Character Matrix Library


It was a fashion to read Chinese Character Matrix Library (CCML) and display chinese character without chinese operation system. It's critical when we only had 640K memory, and 40M hard drive. But now it can only be used in Industrial Control Fields. This is the result of development of hardware, and greatly waste of memory, like Windows.

Let's observe CCML:
Characters in Matrix 16*16 Library are listed by their Code, and there are 32 bytes (256 bits) for every character. For example, the information of a character should be saved like this:
0000000000000000
0000000110000000
0000000110000000
0000000110000000
0011111111111100
0011111111111100
0011000110001100
0011000110001100
0011000110001100
0011000110001100
0011111111111100
0011111111111100
0000000110000000
0000000110000000
0000000110000000
0000000000000000
So that the Code should be:
0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x3f, 0xfc, 0x3f, 0xfc......
Now, you read the code, then you should display it (use putpixel in Turbo C) in proper sequence.
You can also write display buffer to display like this part of source code.It's faster.
You can write a Small Character Information Library for further use, It's also faster.

Here is souce code:
#include < io.h>
#include < graphics.h>
#include < fcntl.h>
#include < dos.h>
#define CCLIB "C:\HZK16"
display(unsigned char *matrix,int x,int y,int color)
{
 int i,j,y2;
 for(i=0; i < 16; ++i) {
	 for(j=0; j < 8; ++j) 
		if (matrix[i+i]&(1 < < (7-j)))  
			putpixel(x+j,y,color); 
	 for(j = 0; j < 8;++j)  
		if(matrix[i+i+1]&(1 < <  (7-j))) 
			putpixel(x+j+8,y,color); 
	 y++; 
	} 
} 

main() 
{ int col,row,handle; 
 unsigned qh,wh;
 unsigned long offset; 
 unsigned char *hz,hzm[32]; 
 unsigned char cz[]= "" ; 
 int driver=DETECT, mode=0; 
 handle= open(CCLIB,O_RDONLY|O_BINARY); 
 if(handle== -1) {
	 printf("Can't open the cclib!");
	 exit(-1);
	 } 
 initgraph(&driver,&mode,"");
 col=130;row=150; 
 hz=cz; 
 while(*hz){ 
	 qh=*hz-0xa0; 
	 wh=*(hz+1)-0xa0; 
	 offset=(94*(qh-1)+(wh-1))*32l;
	 lseek(handle,offset,SEEK_SET); 
	 read(handle,hzm,32); 
	 display(hzm,col,row,12); 
	 col += 16;		// Next character.
	 hz += 2; 
	 } 
 close(handle); 
 bioskey(0); 
 closegraph(); 
} 
In Next Page there's a faster program to show Chinese Characters.
Classic Method to display Chinese Characters Visit Display Buffer to display Chinese Characters (faster) Setup a little Chinese Characters Matrix Library

   Contact Info
  User Support Sales Question Webmaster

Copyright 1998-2002 Fadshop.net, Inc. All rights reserved.