Click here to Skip to main content
15,910,981 members

Comments by DrGrim (Top 5 by date)

DrGrim 6-Jun-14 7:25am View    
Dim xStart, yStart, xEnd, yEnd As Integer
Public Drawbitmap As Bitmap
Dim Drawgraphics As Graphic

Private Sub drawMyline()

PictureBox4.Image = Drawbitmap
Drawgraphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
Drawgraphics.DrawLine(p, xStart, yStart, xEnd, yEnd)
p.StartCap = LineCap.Round
p.EndCap = LineCap.Round

End Sub
put the bellow code under Form1_Load event

PictureBox4.Image = Image.FromFile("somefile.jpg")
PictureBox4.SizeMode = PictureBoxSizeMode.Zoom
Me.WindowState = FormWindowState.Maximized
Drawbitmap = New Bitmap(PictureBox4.Image)
Drawgraphics = Graphics.FromImage(Drawbitmap)
PictureBox4.Image = Drawbitmap
Drawing = False

Private Sub PictureBox4_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox4.MouseDown

Drawing = True

End Sub

Private Sub PictureBox4_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox4.MouseUp

Drawing = False

End Sub

Private Sub PictureBox4_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox4.MouseMove
If Drawing Then
xStart = e.X
yStart = e.Y
drawMyline()

End If
xEnd = e.X
yEnd = e.Y

End Sub

create a new project and put this code in it to see what i mean
DrGrim 5-Jun-14 18:19pm View    
thank you for your reply , i tried using a panel for this but i have the same issue , i can't find a way to fit the image in the panel or picturebox and draw on it properly , the only thing that makes the image fit in the control is if i use zoom but like i said , when i draw on the image the drawing does not start from where the cursor is , it's a bit off.
DrGrim 4-Jun-14 11:10am View    
god bless your soul :D ! Thank you very much !
DrGrim 2-Jun-14 12:55pm View    
here is what i want .
i have this div in a html file (with a carousel plugin inside it)
<div id="owl-example" class="owl-carousel"></div>
inside that div i need to create a n number of other div elements like in the bellow snippet
<div style="height:750px"></div> <-- the number of these div's will be dynamic (ex of math used to generate these divs is : Dim panels As Integer = Math.Round(dirFiles.Length / 102)
dirFiles.length = the number of files in the chosen folder divide by 102 which is 4 so it will create me 4 <div style="height:750px"></div>
-Now comes the fun part
inside the first of the 4 dynamically generated "<div style="height:750px"></div>" i need to insert the first 102 file names then move to the second of the 4 dynamically generated "<div style="height:750px"></div>" and add the next 102 file names and so on until there are no more images. I'm sorry for this long description . I hope you understand what i want now . Thank you
DrGrim 2-Jun-14 12:12pm View    
well i can't find a way to loop through all images and from those 407 images put 102 (image names) in one string then put the next 102 in a different string and so on until there are no more images