VB.NET画线的问题

picArea.Image=Image.FromFile(Application.StartupPath&"\Images\default.png")Dimmybitma... picArea.Image = Image.FromFile(Application.StartupPath & "\Images\default.png")
Dim mybitmap As Bitmap
mybitmap = New Bitmap(picArea.Width, picArea.Height)
picArea.Image = mybitmap

Dim Graph As Graphics = picArea.CreateGraphics

Graph = Graphics.FromImage(picArea.Image)
Graph.DrawLine(Pens.Blue, 0, 0, 111, 111)
Graph.DrawLine(Pens.Red, 111, 111, 200, 0)

怎么加载的图片不见了,如果不画后面的线图就能正常显示!
展开
 我来答
leiyangbdwk
2013-04-28 · TA获得超过3295个赞
知道大有可为答主
回答量:4975
采纳率:12%
帮助的人:4367万
展开全部
picArea.Image = Image.FromFile(Application.StartupPath & "\Images\default.png")
Dim mybitmap As Bitmap
'mybitmap = New Bitmap(picArea.Width, picArea.Height)//你这样是创建了一个空白的底片
mybitmap = New Bitmap(picArea.Image) '这才是利用了图片的背景
picArea.Image = mybitmap
Dim Graph As Graphics = picArea.CreateGraphics
Graph = Graphics.FromImage(picArea.Image)
Graph.DrawLine(Pens.Blue, 0, 0, 111, 111)
Graph.DrawLine(Pens.Red, 111, 111, 200, 0)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式