Jdelagarza#738
I'm not exactly sure how to describe this problem... but, I've loaded a bitmap into the bitmapviewer object, and in a loop and trying to plot points.
If when I Initialize the bitmap object to a new image, I also use the following code:
I see two connected lines on my bitmap... however when the same values are drawn from within a loop, I get one or maybe two pixels of the first line, and nothing else after that. In addition, it seems the bitmap class stops responding to subsequent draw commands.
If I simply add the points to an array, and then use:
I see all the points just fine. Also, substituting g.DrawLine with bmvMain.Bitmap.SetPixel also draws the first 1 or two pixels and then stops responding.
The only thing I can think of that's different from my code in the loop and the initializing code where I draw two subsequent lines is in the loop (where the calls seem to fail) I subsequently call Thread.Sleep before the next iteration of the loop.
Any help would be greatly appreciated 🙂
While I could use the scenario where I load an array as I go, which I'm currently doing as a work around... I would much rather this work properly since I'm intending to show the points and lines being drawn in real time.
If when I Initialize the bitmap object to a new image, I also use the following code:
Dim g As Graphics = bmvMain.Bitmap.GetGdiplusGraphics
g.DrawLine(Pens.White, 0, 80, 15, 100)
g.DrawLine(Pens.White, 15, 100, 18, 76)I see two connected lines on my bitmap... however when the same values are drawn from within a loop, I get one or maybe two pixels of the first line, and nothing else after that. In addition, it seems the bitmap class stops responding to subsequent draw commands.
If I simply add the points to an array, and then use:
g.DrawLines(Pens.White, aryPoints)I see all the points just fine. Also, substituting g.DrawLine with bmvMain.Bitmap.SetPixel also draws the first 1 or two pixels and then stops responding.
The only thing I can think of that's different from my code in the loop and the initializing code where I draw two subsequent lines is in the loop (where the calls seem to fail) I subsequently call Thread.Sleep before the next iteration of the loop.
Any help would be greatly appreciated 🙂
While I could use the scenario where I load an array as I go, which I'm currently doing as a work around... I would much rather this work properly since I'm intending to show the points and lines being drawn in real time.