我不知道该怎么表达,明明清楚的知道自己的心意,
我不知道该怎么表达,明明清楚的知道自己的心意,
绘制图片
将图片导入项目
放到Resources.cesx
f放在了Resources文件夹内
Resource类,把所有资源放在了静态资源(加载静态资源)
如果需要引用这些资源,需要加入Resources的命名空间
使用资源
Resources.Boss //类型是bitmap,或是Image
Image image = Properties.Resources.Boss
g.DrawImage 方法
收缩代码(灰色字体表示)
#region 说明文字
#endregion
使用Image来接收资源
也可以使用Bitmap(继承自Image)可以使用另外一些功能:例如制定尺寸,让某个颜色变成透明)
MakeTransparent(某个颜色)
指定图片一种颜色透明:
名字.MakeTransparent(Color.要透明的颜色)
bm.MakeTransparent (color.Black)
把某个颜色改为透明(例:黑色改为透明)
Image image = Properties.Resources.Boss;
Bitmap bm = properties.Resources.EXP4
g.DrawImage(bm,150,150);
#region
#endregion: 收缩代码, 方便管理。