Character generation in C - program
#include <graphics.h>
#include <conio.h>
#include <math.h>
void generatecharback();
void generatechar(char);
void main()
{
int gdriver, gmode;
gdriver=DETECT;
gmode=EGAHI;
initgraph(&gdriver,&gmode,"");
setbkcolor(4);
generatecharback();
generatechar('B');
outtextxy(203, 200, "char generation");
getch();
closegraph();
}
void generatecharback(){
int i=0;
int j=0;
for(i=0;i<=7;i++){
for(j=0;j<=7;j++){
putpixel(i+100,j+100,8);
}
}
}
void generatechar() {
int charray[1][65]={{1,1,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0}};
int i,j,k;
k=0;
for(i=0;i<=7;i++){
for(j=0;j<=7;j++){
if(charray[0][k]==1){
putpixel(j+100,i+100,WHITE);
}
k++;
}
}
}
No comments:
Post a Comment