已有56人关注
关于《C#程序开发范例宝典》中特殊形状的窗体
发表在C#图书答疑 2012-10-16
是否精华
版块置顶:
《C#程序开发范例宝典》第25页中的特殊形状的窗体:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace Ex01_22
{   
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
               
            bit = new Bitmap("888.bmp");
            bit.MakeTransparent(Color.White);
           
        }


        protected override void OnPaint(PaintEventArgs e)
        {
                  e.Graphics.DrawImage((Image)bit, new Point(0, 0));
        }



    }
}
报错:当前上下文中不存在名称"Bit".(由于第一章的源代码丢失,第二章以后的代码都有,所以我只能按照书本的代码写下来)
分享到:
精彩评论 1
小科_mrkj
学分:43 LV2
2012-10-19
沙发
读者朋友:
    您好,请先创建一个Bitmap位图对象。
首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照