您现在的位置:多问网知识中心电脑教学软件技巧计算机移屏广告画面设计

计算机移屏广告画面设计

10-12 02:53:37   浏览次数:70926  栏目:软件技巧
标签:办公软件技巧,软件测试面试技巧,办公软件使用技巧,http://www.duowen123.com 计算机移屏广告画面设计,
源程序scroll.c如下:
        /* scroll.c */
        #include <stdio.h>
        #include <stdlib.h>
        #include <graphics.h>
        #include <dos.h>
        unsigned long count=0;
        unsigned saveptr;
        int putspt(char *sptf,int x1,int y1,int color);
        void scroll(int,int);
        /*--------*/
        main()
        {
        char far *ptr;
        int gd=9,gm=2;
        initgraph(&gd,&gm," ");
        setfillstyle(1,1);
        bar(0,135,639,230);
        putspt("exam.spt",10,10,14);
        /*保存起始地址*/
        ptr=MK-FP(0x40,0x4e);
        saveptr=*ptr;
        while(1)
        { if(kbhit()) break;
        ptr=MK-FP(0x40,0x4e);
        scroll(1,400);
        }
        /*恢复起始地址*/
        ptr=MK-FP(0x40,0x4e);
        *ptr=saveptr;
        closegraph();
        }
        /**********/
        void scroll(int direction,int delay-time)
        { char far *ptr;
        unsigned ccw;
        char cch,ccl;
        ptr=MK-FP(0x40,0x4e);
        switch(direction){
        case 1: /* move right */
        /*修改显示指针*/
        *ptr-=1;count-=1;
        if(count<0){ *ptr+=1;count+=1; }
        delay(delay-time);
        break;
        case -1: /* move left  */
        *ptr+=1;count+=1;
        delay(delay-time);
        break;       }
        ccw=*ptr;
        ccl=(char)ccw;
        cch=(char)(ccw>>8);
        /*选择显存起始地址(高)*/
        outportb(0x3d4,12);
        outportb(0x3d5,cch);
        /*选择显存起始地址(低)*/
        outportb(0x3d4,13);
        outportb(0x3d5,ccl);
        }
        /**********/
        int putspt(char *sptf,int x1,int y1,int color)
        {
        /* 略 */
        unsigned char dot;
        FILE *fp;
        int h,w,i,j,k,p,x,y;
        fp=fopen(sptf,"rb");
        fseek(fp,34L,SEEK-SET);
        fread(&w,2,1,fp);
        fseek(fp,36L,SEEK-SET);
        fread(&h,2,1,fp);
        if(fseek(fp,64L,SEEK-SET)) return(1);
        for(i=0;i<h;i++)
        { y=y1+i;
        for(j=0;j<w/8;j++)
        {
        x=x1+8*j;dot=fgetc(fp);p=0x80;
        for(k=0;k<8;k++)
        {
        if(!(dot&p))  putpixel(x+k,y,color);
        p>>=1;
        }
        }
        }
        fclose(fp);return(0);
        }
 

,计算机移屏广告画面设计
相关热词搜索: tag: 软件技巧,办公软件技巧,软件测试面试技巧,办公软件使用技巧,电脑教学 - 软件技巧
上一篇:几种将文本文件转换为可执行文件工具软件的用法
《计算机移屏广告画面设计》相关文章
文章评论
联系我们 | 网站地图 | 范文大全 | 管理资料 | 驾照考试 | 教学资料 | 名言大全 | 软件下载
Copyright @ 多问网 all rights reserved
学生评语_教案设计_小学语文试卷
1 2 3 4 5 6 7 8 9 10 11 12