| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 395 人关注过本帖
标题:为什么编译能通过,运行时却没效果。
只看楼主 加入收藏
chenweijun
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-4-25
收藏
 问题点数:0 回复次数:0 
为什么编译能通过,运行时却没效果。
class apple
    {
        public int x;
        public int y;
        public Bitmap tupian=null;

        public  apple()        
        {
        tupian = new Bitmap(500,500);

         }
        public Bitmap  move()
        {
            Graphics g = Graphics.FromImage(tupian);
            Pen p = new Pen(Color.Red);
            g.Clear(Color.Yellow);
            g.DrawEllipse(p, x, y, 50, 100);
           
            x = x + 5;
            y = y + 5;
            return tupian;


        }


         

    }
    //以下是window窗口下的form1.
    public partial class Form1 : Form
    {
        apple abc = new apple() ;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }


        private void timer1_Tick(object sender, EventArgs e)
        {
            pictureBox1.Image = abc.move();

        }

      
      


      
    }

搜索更多相关主题的帖子: tupian return apple null 
2011-04-26 20:20
快速回复:为什么编译能通过,运行时却没效果。
数据加载中...
 
   



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

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