Hi,
I have been having a very hard time wrapping my head around drawing in vb.net
Here is what I am doing,
So I am creating a image that is 1261 x 1249 and then I draw on this image a line from the bottom to the top.
I then set this image to my picture box which has dimensions of 638 x 723. But the line never shows up or shows up at a random place. It is very furstrating lol.
Does my logic make sense?
I have been having a very hard time wrapping my head around drawing in vb.net
Here is what I am doing,
vb.net Code:
Public Class Form1 Dim _Pen As Pen Dim min As System.Drawing.Point = New Point(521, 211) Dim max As System.Drawing.Point = New Point(1261, 1249) Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click If max.X = 0 Then Exit Sub End If Dim Img As New Bitmap(max.X, max.Y) Dim g As Graphics = Graphics.FromImage(Img) g.Clear(Color.White) _Pen = New Pen(Brushes.LightBlue, 5) _Pen.DashStyle = DashStyle.Dash g.DrawLine(_Pen, min.X, min.Y, max.X, max.Y) PictureBox1.Image = Img End Sub End Class
So I am creating a image that is 1261 x 1249 and then I draw on this image a line from the bottom to the top.
I then set this image to my picture box which has dimensions of 638 x 723. But the line never shows up or shows up at a random place. It is very furstrating lol.
Does my logic make sense?