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)
怎么加载的图片不见了,如果不画后面的线图就能正常显示! 展开
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)
怎么加载的图片不见了,如果不画后面的线图就能正常显示! 展开
1个回答
展开全部
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)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询