登录 | 注册

首页 | 学习中心 | 下载中心 | 知识大全 | 作文 | 常识 | 加入收藏 | 网站地图

您当前位置:多思学习网知识频道电脑学习软件技巧用C语言设计立体按钮

用C语言设计立体按钮

11-08 12:39:07软件技巧
浏览次数:499次 
标签:软件技巧大全,http://www.duosi8.com 用C语言设计立体按钮,
 #include<graphics.h>
        drawbutton(int left_x,int top_y,int right_x,int bottom_y,int linew,int col)
        /*本模块为画按钮函数*/
        /*left_x,top_y为按钮左上角坐标,right_x,bottom_y为按钮右下角坐标*/
        /*col为按钮颜色*/
        /*linew为按钮的边框宽度*/
        {
        int svcolor=getcolor(); /*返回当前画线颜色*/
        struct fillsettingstype save;
        getfillsettings(&save); /*取得有关当前填充模式和填充颜色的信息*/
        setfillstyle(SOLID_FILL,col); /*设置填充颜色*/
        setcolor(col); /*设置画线颜色*/
        bar(left_x,top_y,right_x,bottom_y); /*画实心方框*/
        setcolor(svcolor); /*设置画线颜色*/
        line(left_x,bottom_y-2,left_x,top_y); /*画方框外面左边的线*/
        line(left_x,top_y,right_x,bottom_y); /*画方框外面左边的线*/
        line(left_x+linew,bottom_y-linew,right_x-linew,bottom_y-linew;
        /* 画方框里面下边的线*/
        line(right_x-linew,bottom_y-linew,right_x-linew,top_y+linew);
        /*画方框里面右边的线*/
        setcolor(0); /*设置画线颜色*/
        line(left_x+linew,top_y+linew,right_x-linew,top_y_linew);
        /*画方框里面左边的线*/
        line(left_x+linew,bottom_y-linew,left_x+linew,top-y+linew; /*画方框里面上边的线*/
        setcolor(svcolor); /*恢复原来的画线颜色*/
        setfillstyle(save.pattern,save.color); /*恢复原来的填充模式和颜色*/
        return; /*返回调用程序*/
        }
        main()
        {
        int GraphDriver;
        int GraphMode;
        GraphDriver=DETECT;
        initgraph( &GraphDriver,&GraphMode,""); /*初使化图形屏幕*/
        drawbutton(10,10,100,100,7,7); /*在屏幕左上角为(10,10)至*/
        getch(); /*右下角为(100,100)处画一按钮*/
        closegraph();
        }
       
 

,用C语言设计立体按钮
《用C语言设计立体按钮》相关文章

tag: C语言  软件技巧,软件技巧大全,电脑学习 - 软件技巧

联系我们 | 网站地图 | 幼教大全 | 试题下载 | 电脑学习 | 加入收藏


幼儿园教案_ 教案模板_ 课件模板_ 教学反思_ 教学计划


多思学习网 1 2 3 4 5 6