| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 488 人关注过本帖
标题:求高人指教,GD与数组结合的问题
取消只看楼主 加入收藏
zfm0210
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2011-11-18
结帖率:60%
收藏
已结贴  问题点数:20 回复次数:4 
求高人指教,GD与数组结合的问题
小弟已经写了一段程序是可以将
图片附件: 游客没有浏览图片的权限,请 登录注册
显示出来的。用的是switch的语句,但是好像感觉程序太长了,希望可以有更加简单的办法。因为以前有做过一个text版本是用数组来做的,所以小弟试想用数组来试试看。

希望有高手能提示下,更好,更简便的方法
搜索更多相关主题的帖子: 工作 
2012-03-14 22:08
zfm0210
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2011-11-18
收藏
得分:0 
回复 3楼 TonyDeng
可以看到,请问是用什么方法来做的啊?
2012-03-16 05:39
zfm0210
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2011-11-18
收藏
得分:0 
回复 2楼 zaixuexi
刚刚在学,还在摸索,所以不是很明白a
2012-03-16 05:41
zfm0210
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2011-11-18
收藏
得分:0 
这个是我现在写的程序,是可以显示出图片,但是我觉得应该可以更简单的方法,希望可以指点下[code]#include <stdio.h>
#include <gd.h>
 
int main()
{
 
  
  FILE *jpgFile = NULL;
 gdImagePtr gdImage =gdImageCreate (600,200);
 
 
 
  int black;
  int red;
 
  int a,b,c,d;
  scanf("%1d%1d%1d%1d",&a,&b,&c,&d);
 
 
   
    black = gdImageColorAllocate(gdImage, 0, 0, 0);
     
   
    red = gdImageColorAllocate(gdImage, 255, 0, 0);
   
   
    gdImageSetPixel(gdImage, 60, 100, red);
   
    switch (a)  
      {         
        case 0 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 20, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 1 : gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );break;
                 
         case 2 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 3 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 4 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );            
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 5 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 6 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 7 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 8 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;
                 
         case 9 : gdImageFilledEllipse( gdImage, 20, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 20, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 40, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 60, 100, 20, 20, red );break;           
                 
        }                 
                        
                 
    switch (b)
       {
          case 0 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 80, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                  
          case 1 : gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 40, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 80, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );break;
                  
          case 2 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );      
                   gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 80, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                   gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                  
         case 3 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
         
        case 4 :  gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );            
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                 
         case 5 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                 
         case 6 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                 
         case 7 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;                                                   
                  
         case 8 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                 
         case 9 : gdImageFilledEllipse( gdImage, 100, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 100, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 120, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 140, 100, 20, 20, red );break;
                           
       }
2012-03-16 05:48
zfm0210
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2011-11-18
收藏
得分:0 
switch (c)
      {     
        case 0 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 180, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 1 : gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );break;   
                 
         case 2 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 3 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 4 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );            
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 5 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 6 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 7 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 8 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
         case 9 : gdImageFilledEllipse( gdImage, 180, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 180, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 200, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 220, 100, 20, 20, red );break;
                 
      }
                                                                                                            
    switch (d)
      {
        case 0 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 260, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                 gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;
                 
         case 1 : gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );break;     
                 
         case 2 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;   
                 
         case 3 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );      
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;
                 
         case 4 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );            
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;
                 
         case 5 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;
                 
         case 6 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;   
                 
         case 7 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;     
                 
         case 8 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;   
                 
         case 9 : gdImageFilledEllipse( gdImage, 260, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 20, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 40, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 60, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 80, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 260, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 280, 100, 20, 20, red );
                  gdImageFilledEllipse( gdImage, 300, 100, 20, 20, red );break;         
                                                                     
       }
                  
   
  jpgFile = fopen( "test.jpg", "wb" );
  gdImageJpeg( gdImage, jpgFile, -1 );
 
 
  fclose( jpgFile );
 
    gdImageDestroy(gdImage);
} [/code]
2012-03-16 05:48
快速回复:求高人指教,GD与数组结合的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041686 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved