入门级问题“如何把gdi绘制的图存到imagelist中”

如题:
Graphics graphic = this.CreateGraphics();

SolidBrush sldbrush = new SolidBrush(Color.Blue);

graphic.FillRectangle(sldbrush, new Rectangle(100, 100, 100, 100));

这个矩形如何存到imagelist.images[0]中呢?
...全文
245 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Regan-lin 2013-07-21
  • 打赏
  • 举报
回复
你用GDI+居然不知道用Bitmap···
全栈极简 2013-07-21
  • 打赏
  • 举报
回复
引用 楼主 nanfeiyannan 的回复:
如题: Graphics graphic = this.CreateGraphics(); SolidBrush sldbrush = new SolidBrush(Color.Blue); graphic.FillRectangle(sldbrush, new Rectangle(100, 100, 100, 100)); 这个矩形如何存到imagelist.images[0]中呢?
加这两句:
 Bitmap bitmap = new Bitmap(100, 100, graphic);
            this.imageList1.Images.Add(bitmap);
李森的博客 2013-07-21
  • 打赏
  • 举报
回复
先保存在调用

111,132

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧