Button本来就能响应鼠标动作,至于图片,我也想知道
解决方案 »
- winform,为什么textbox要移动一下焦点才能保存数据?
- can't create component 'AxHost'
- 求一个WinForm中关于数据的方法
- 求助,我使用c# 做了一个关机小软件.但在电脑锁屏状态下无法关机
- 对不起打扰了,问个简单的问题
- 为什么我的 VS 2003。NET安装好后,可以新建ASP。NET WEB应用程序,然后过后一些时间不用,却说我的asp.net服务器版本不是1.1
- MP3文件读取的问题,如何读取最后128Byte的内容?
- 关于listBox 的问题
- 请教:datagridview中判断没有选择行
- 如何根据类名称(字符串)得到该类的实例?
- 用ms C# 作一个windows应用程序,遇到了显示图表的问题,大家帮忙指点一下
- 使用接口的问题,请高手指点
这个可以用工具做,跟c#是没有关系的。
可以生成16*16, 32*32, 64*64, 128*128等等。因为同一个图片可能在不同的场合下,大小是不一样的,主要派这个用场吧,比如在右下角的任务栏目里面它是16*16,在windows的菜单栏里面的大小可能是大一点的,你可以把windows的显示方式改成“大”来试一下。
我知道有些工具可以生成,感兴趣可以去google找一下。
private ImageList loadImageList(string str)
{
Bitmap bitmap = new Bitmap(str);
int count = (int) (bitmap.Width / bitmap.Height);
ImageList imageList = new ImageList();
imageList.ColorDepth=ColorDepth.Depth32Bit;
//imageList.ImageSize=new Size(bitmap.Width,bitmap.Width);
imageList.TransparentColor=Color.FromArgb(255,0,255);
Rectangle rectangle = new Rectangle(0, 0, bitmap.Height, bitmap.Height);
for (int i = 0; i < count; i++)
{
imageList.Images.Add(bitmap.Clone(rectangle, bitmap.PixelFormat));
rectangle.X += bitmap.Height;
}
return imageList;
}