vb.net如何处理picturebox.paint绘制的图形

chillystar 2008-07-21 08:54:38
在VB.NET中
用picturebox_paint绘制了一幅图,想Add到ImageList中应该用什么方法?我想用picturebox.image.save来保存绘制的图形,但提示picturebox.image=null
...全文
241 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
yanlongwuhui 2008-07-21
  • 打赏
  • 举报
回复
不要直接在picturebox中画,先创建个bitmap,在bitmap中画,然后再picturebox_paint中把bitmap赋值给PictureBox1的Image对象。保存的时候调用bitmap对象的save。参考如下:
objBitmap = New Bitmap(PictureBox1.Width, PictureBox1.Height, PixelFormat.Format16bppRgb555)
Dim g As Graphics = Graphics.FromImage(objBitmap)
g.Clear(Color.White)
g.DrawEllipse(Pens.Blue, New Rectangle(10, 10, 100, 100))
PictureBox1.Image = objBitmap

objBitmap.Save("文件名")
chillystar 2008-07-21
  • 打赏
  • 举报
回复
谢谢,完全明白.结贴

16,721

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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