SEARCH YOUR SOLUTION HERE  

Drawing on Vb.net

I was able to make a program that can draw on a form but if I draw so quick the lines are cut.
Check image given below :
How am I going to resolve this
Another is I need to make my form be able to load a power point presentation. Is it possible
Also, I was thinking if It's possible to save the form as image file like what we do in screen capture
This post has been updated by k3nnt0ter0: 18 May 2012 - 08:35 AM
Posted On: Monday, December 3, 2012 Total Views: 6
View Complete with Replies




Related Messages:

Graphics Object not drawing  (2 Views)
Why does not this work
Code snippet:
Imports System.Drawing
....
Dim g As Graphics = Me.CreateGraphics
g.DrawString("World" New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Point), Brushes.Cyan, 5, 5)
g.Dispose()
View Replies !
I have a trouble drawing dotted path lines with evenly spaced dots  (7 Views)
I have a difficulty drawing dotted path lines with evenly spaced dots:
Can anybody pls assist By this difficulty, I need to be able to draw evenly spaced dots along a path line using points in an array, My problem isn't with drawing the path line, with dotted lines, this is simple, but with the spacing of the dots at the start and end of the path line.
In the example I have generated, I generate a square with 4 points and draw a dotted path.
The path starts at the top left corner and completes back at the top left corner, the dots are evenly placed along the path, except the final dots at the end of the path. (Sometimes the dots are even and other times tare not even).
The shapes I need to draw can be any size and any shape, but I have used a square in this example to display the problem I have.
Can anybody pls assist me to draw the dots and provide the impression that they are even all along the path, for all shapes and sizes.
I have attached an example project or u can download from here:
http: craftysams.co... dottedline.zip
Dotted Line Code snippet
I have also attached two photos displaying the dotted path line, 1 with even spaced dots at the start End and another displaying the problem I need to resolve, with not evenly spaced dots at the start end.
The only difference b/w the two is the point values.
Good: This picture displays a path line that has dots that look even, this is what I need to achieve on all path lines I draw of any size and shape, if u can't view picture download from here: http: craftysams.co...images good.jpg

Bad: This picture displays a path line that has dots that clash at the start and end of the path line THIS IS THE PROBLEM I Need to RESOLVE, if u can't view picture download from here: http: craftysams.co..._images bad.jpg

View Replies !
VBNet - Trying to recognize the best point to start drawing text within  (2 Views)
Imagine a television advert with a price in a star. As a learning exercise in GDI+ how do u generate some thing like that
My difficulty is twofold. First, the overall ObjectI have is to find the best point within a multipoint filled 'star', at that to start drawing text. That is, depending upon the size of the star and the number of points, there is a larger or smaller area within the points that is filled with colour. So a 5 point star has a relatively small area that is filled, in that to draw text. A 40 point star of the same radius has a much larger area filled. If I can determine the size of this area as a rectangle, then I can measure the string and draw within it using the best fit font and starting position. The code snippet below is an intend to answer the question but I'm stuck attempting to find the text area rectangle within the filled portion of the star. Some of the code exists purely to explore the means to determine how can i recognize this rectangle (and is maybe the totally wrong direction).
The second part of the difficulty is in exploring the options, I tried to draw a vector to various points on the circumference of the star. This is the code highlighted. The lines drawn do not seem to be the correct length nor the correct angle but I can't view why.
View Replies !
How do I connect to Autocad and open a drawing?  (2 Views)

I am using visual Studio 2010
And Autocad 2011
Can not seem to communicate with Autocad
using VB.
View Replies !
Problems drawing more than one lines on a canvas. (VB.net WPF)  (5 Views)
So I built myself an easy program to work out the kinks of drawing in my softwares.
I have a button that I press that when the textbox.text reads 1 it then draws a line of a specific height color and position, the difficulty is when I click that button again it will crash informing me that...
"Specified Visual is already a child of another Visual or the root of a CompositionTarget."
CODE IS Given below
Class MainWindow
Dim line As New Line
Dim drawruncount As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
'code given below will draw a line if a 1 is detected in the textbox.
'drawruncount variable is to be used in conjunction with X co-ordinates so that the line utility can move to the right 1 pixel each digit.

If TextBox1.Text = 1 Then
Call Blacklinedraw()
drawruncount = (drawruncount + 1)
End If
runcount.Content = drawruncount
End Sub
Private Sub Blacklinedraw()
line.Stroke = Brushes.Black
'Possibly make x1= a variable that way it can count and keep track of a dynamic location on the canvas.
line.X1 = drawruncount
line.X2 = drawruncount
line.Y1 = 10
line.Y2 = 80
line.HorizontalAlignment = HorizontalAlignment.Left
line.StrokeThickness = 1
Canvas1.Children.add(line)
End Sub
Private Sub MainWindow_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
drawruncount = 9
End Sub
End ClassI know where the difficulty lies, its with the Canvas1.children.add(line), cause its telling me the line variable is already been used or in use on the canvas, I am just uncertain of how can i turn that into a solution that will let me to click the button a hundred times or more with out being forced to MANUALLY make a hundred or more individual variables to store the line.
Any ideas are appriciated.
View Replies !
Confused to create and drawing in corel files in vb.net  (4 Views)
Friend
I confused to make the corel files in vb.net. And once it generated i need to draw inside that file in vb.net. I need to draw rectangles, lines, arc and more.inside the corel file.
So assist me quick bcaz its urgent.
Thanks in advanced.
BByeHey Friend Sir,
I confused to make the corel files in vb.net. And once it generated i need to draw inside that file in vb.net. I need to draw rectangles, lines, arc and more.inside the corel file.
So assist me quick bcaz its urgent.
Thanks in advanced.
BBye
View Replies !
How do I drawing tools box used in vb.net  (2 Views)
How can i used drawing utility box in vb.net. i need to design graph page to used Ellipse Rectangle, lines and more. as par Requirement not particular size and draw mouse
This post has been updated by Mukesh Naiknavare: 13 March 2010 - 02:42 AM
View Replies !
drawing shapes  (5 Views)
how do u correctly dispose a shape in vb.net ie when u draw a rectangle using the pen function How can I depose it so that it will disappear from the form for some reason once its drawn if I draw a new shape it keeps the previous one and just overlays the new one and I use shape.dispose, and pen.dispose
View Replies !
create autocad drawing by visual studio  (10 Views)

I am attempting to generate an autocad drawing in visual studio with the code snippet :
Dim strTemplatePath As String = "C: acad.dwt" Dim acDocMgr As Documentcollection = Software.DocumentManager
Dim acDoc As Document = acDocMgr.add(strTemplatePath)
acDocMgr.MdiActiveDocument = acDoc
However when I try to execute the program I receive an filenotfoundexception and the program asks me to verify if the file exists in the specified location. The file does exist in the specified location. Any solutions what could be wrong or missing in my code
View Replies !
Questions about drawing on a panel  (2 Views)
I have a software that allows a user to select a color and the width of the pen to draw with on the included panel. I have most it working decently except for many remaining pieces. First whenever the user starts drawing the lines and panel visibly flicker and I can't figure out how can i resolve it. I tried things like doublebuffer but it did not work. It's maybe some thing I did wrong as this is my first intend at drawing in vb.net.
My second problem is that if u draw a line with one color and than switch to another color the earlier drawn lines and more. alter to the new color. I wana them to stay the same but can't figure out how.
My last question is I can receive the radiobuttons to work in terms displaying only the correct one as checked. However the width of the pen does not alter when used to draw. I was able to receive it to alter with the code snippet below but it gets thinner instead of wider as the width listed gets higher plus like the color problem the width of earlier drawn lines changes as well that it should not
Given below is the code I recently have
Public Class frmDrawingPad
Dim index As Integer = 0 ' sets index for combobox control
Dim mousePath As New System.Drawing.Drawing2D.GraphicsPath()
Dim userColor As New Color() 'this is a color the user selects
Dim penWidth As Single
Dim rbChecked(3) As RadioButton
Private Sub ClearToolStripMenuitem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearToolStripMenuitem.Click
' calls procedure that clears panel
Call ClearDrawingPanel()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
' calls procedure that clears panel
Call ClearDrawingPanel()
End Sub
Private Sub panelDraw_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles panelDraw.MouseDown
If e.Button = MouseButtons.Left Then ' draw a filled line if left mouse is down
mousePath.StartFigure()' The L mouse is down so we want to start a new line in mousePath
End If
End Sub
Private Sub panelDraw_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles panelDraw.MouseMove
If e.Button = MouseButtons.Left Then ' draw a filled cline if left mouse is down
Try
mousePath.AddLine(e.X, e.Y, e.X, e.Y)'Add mouse coordiantes to mousePath
Catch
MsgBox("No way, Hose ")
End Try
End If
panelDraw.Invalidate()
End Sub
Private Sub panelDraw_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles panelDraw.Paint
Try ' error message trapping
'*********************** NOTE ***********************************************
'The line given below set the pen up with the capability to add user selected Alpha, Color and Penwidth
' A simpler, but less flexible solution would be to interchange the line with the following code:
'Dim CurrentPen = New Pen(System.Drawing.Color.Black, myPenWidth)
'************ End Note ***************************
Dim CurrentPen = New Pen(userColor, penWidth) 'Set up the pen
e.Graphics.DrawPath(CurrentPen, mousePath) 'draw the path
Catch
' MsgBox("Not happening ")
End Try
End Sub
Public Sub ClearDrawingPanel()
' clears drawing panel
Dim g As Graphics = panelDraw.CreateGraphics
g.Clear(panelDraw.BackColor)
mousePath.Reset()
g.Dispose()
End Sub
Private Sub frmDrawingPad_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' loads list of colors to combobox
cboColorPick.items.add("Pick A Color")
cboColorPick.items.add("Black")
cboColorPick.items.add("Blue")
cboColorPick.items.add("Pink")
cboColorPick.items.add("Red")
cboColorPick.items.add("Green")
cboColorPick.items.add("Yellow")
cboColorPick.items.add("Purple")
' assigns radiobuttons to array
rbChecked(0) = rbWidth1
rbChecked(1) = rbWidth5
rbChecked(2) = rbWidth10
rbChecked(3) = rbWidth20
End Sub
Private Sub cboColorPick_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboColorPick.SelectedIndexChanged
' assigns to index the combobox index of the selected color
index = cboColorPick.SelectedIndex
' calls procedure that assigns color to pen
Call AssignPenColor(index)
End Sub
Private Sub AssignPenColor(ByVal index As Object)
' takes passed index collected from selection in combobox and checks to view that case it matches. once correct one is found
' the userColor variable is assigned the appropriate color
Select Case index
Case 1
userColor = Color.Black
Case 2
userColor = Color.Blue
Case 3
userColor = Color.Pink
Case 4
userColor = Color.Red
Case 5
userColor = Color.Green
Case 6
userColor = Color.Yellow
Case 7
userColor = Color.Purple
End Select
End Sub
' handles checkedchanged event for all radiobuttons
Private Sub rbWidth1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbWidth1.CheckedChanged, _
rbWidth5.CheckedChanged, rbWidth10.CheckedChanged, rbWidth20.CheckedChanged
penWidth = 0
Dim i As Integer = 0
Dim found As Boolean = False
' runs by loop until it searches the radiobutton that was selected within the rbChecked array
While i
View Replies !
save drawing with picture  (2 Views)
I wana the command that save my drawing with picture
please assist
[Admin Update: Fixed spelling bugs]
View Replies !
Redrawing graphics on a second form  (3 Views)

I'm working on a software with more than one forms. On the first form, the user clicks a button and an easy shape is drawn in a picturebox. Depending on that shape is drawn, a value is assigned to a global variable called baseShape. I wana that shape to be drawn automatically on the next form when that form is shown. I have not been able to find any discussion on "passing graphics" from one form to another.
View Replies !
Difficulty drawing rectangle on form  (2 Views)
I'm working on a project for class that includes code snippet for analyzing the strength of a password. I've the code working for the actual analysis however the project requires graphics be included. I need to include a bar that displays the current strength of the password in color ie red for poor. I figured this would be a good place to incorporate the graphics requirement. Recently I'm having an problem getting the initial rectangle to appear on the form. I could use some assist attempting to find out what I'm doing wrong. The actual drawing is recently setup to be read during the forms load event but I included all of the code in case it can assist make the error message more obvious.
ThanksImports System.Diagnostics
Public Class frmPswdAnalyzer
Private g As Graphics
Private myRectangle As Rectangle
Private myPen As New Pen(Color.Black)
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
' clears password textbox
txtPassword.Text = ""
End Sub ' btnClear_Click
Private Sub chkUseMasked_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkUseMasked.CheckedChanged
' if use masked input checkbox is checked the text inputted into the password textbox will be masked by asteriks
If chkUseMasked.Checked Then
txtPassword.PasswordChar = "*"
txtPassword.UseSystemPasswordChar = True
Else
txtPassword.PasswordChar = ""
txtPassword.UseSystemPasswordChar = False
End If
End Sub ' chkUseMasked_CheckedChanged
Private Sub txtMaximum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMaximum.TextChanged
Dim i As Long
Dim strNum As String
strNum = ""
For i = 1 To Len(txtMaximum.Text)
If IsNumeric(Mid(txtMaximum.Text, i, 1)) Then
strNum = strNum + Mid(txtMaximum.Text, i, 1)
End If
Next i
txtMaximum.Text = strNum
' btnAnalyzePassword_Click(sender, e)
End Sub
Private Sub txtMinimum_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMinimum.TextChanged
Dim i As Long
Dim strNum As String
strNum = ""
For i = 1 To Len(txtMinimum.Text)
If IsNumeric(Mid(txtMinimum.Text, i, 1)) Then
strNum = strNum + Mid(txtMinimum.Text, i, 1)
End If
Next i
txtMinimum.Text = strNum
'btnAnalyzePassword_Click(sender, e)
End Sub
Private Sub txtPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPassword.TextChanged
txtTotalCharacters.Text = CStr(Len(txtPassword.Text))
' btnAnalyzePassword_Click(sender, e)
End Sub
Private Sub btnAnalyzePassword_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnalyzePassword.Click
Dim dAverage As Double
Dim oAnalizer As New cAnalysis
if (Len(txtPassword.Text) > 0) Then
oAnalizer.Reinitialize()
If Len(txtMinimum.Text) = 0 Then txtMinimum.Text = "7"
If Len(txtMaximum.Text) = 0 Then txtMaximum.Text = "10"
oAnalizer.lPwdLMin = CLng(txtMinimum.Text)
oAnalizer.lPwdLMax = CLng(txtMaximum.Text)
dAverage = oAnalizer.dCheckPasswordStrength(txtPassword.Text)
lblLengthPass.Text = oAnalizer.dLength
lblCapitalsPass.Text = oAnalizer.dCapitals
lblNumbersPass.Text = oAnalizer.dNumerals
lblSpecialSymbolPass.Text = oAnalizer.dSymbols
lblLowerPass.Text = oAnalizer.dCharacters
lblAverage.Text = CStr(dAverage) + " "
Else
InitFields()
End If
oAnalizer = Nothing
End Sub
Private Sub InitFields()
lblCapitalsPass.Text = "0"
lblLengthPass.Text = "0"
lblLowerPass.Text = "0"
lblNumbersPass.Text = "0"
lblSpecialSymbolPass.Text = "0"
End Sub
Private Sub frmPswdAnalyzer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'return the current form as a drawing surface
g = Graphics.FromHwnd(Me.Handle)
'Create a rectangle on the basis of x,y coordinates, width, & height
myRectangle = New Rectangle(x:=205, y:=47, Width:=192, Height:=36)
'draw rectangle from pen and rectangle Objects
g.DrawRectangle(pen:=myPen, rect:=myRectangle)
End Sub
End Class

View Replies !
Parameter is not valid error while drawing a rectangle  (4 Views)
I hope that somebody would be able to assist me.
I have made a program that allows you to select an area of a picture and then crop it, I'm having difficulties while drawing the rectangle that displays that area will be cropped, following is my code snippet. Dim CanvasGraphics As Graphics
Dim FirstLeft As Integer
Dim FirstTop As Integer
Dim CropWidth As Integer
Dim CropHeight As Integer
Dim MouseDn As Boolean = False
This is declaration of all the variables that I'm using. Private Sub Canvas_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Canvas.Paint
CanvasGraphics = e.Graphics
End Sub
Over here I send the graphics handle of the "canvas" control (which is just a picturebox) to a higher level, so I can use it later. Private Sub Canvas_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Canvas.MouseDown
FirstLeft = e.X
FirstTop = e.Y
MouseDn = True
End Sub
Over here I receive the starting position for my rectangle Private Sub Canvas_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Canvas.MouseMove
If MouseDn = True Then
CropWidth = e.X - FirstLeft
CropHeight = e.Y - FirstTop
If CropWidth > 4 And CropHeight > 4 Then
CanvasGraphics.DrawRectangle(Pens.Red, FirstLeft, FirstTop, CropWidth, CropHeight)
End If
End If
End Sub
This part is supposed to draw the rectangle, as I'm moving the mouse over the Canvas control, but I receive an error message where the rectangle is being drawn, I basically thought that the difficulty might have been with the fact that as soon as I begin moving the mouse, the CropWidth and CropHeight variables are at zero, and that is causing the invalid input error. So I made it that it wouldn't draw the rectangle until it reached a minimum size of 4 x 4 pixels but it still does not resolve the error, I debugged to view if there was a difficulty with the values of the variables, but tall seemed fine, I even tries doing this
CanvasGraphics.DrawRectangle(Pens.Red, 20, 20, 20, 20)
so as to eliminate the factor of the wrong values, but still the same error.
It would be really great if somebody here could point out what may be wrong By this, or Probably guide me to a improve solution.
I was thinking that if this did not work I'd use Panels, instead of drawing the rectangles.
View Replies !
brick breaker collision and drawing  (4 Views)
I'm writing a brick breaker game. And I have come across a difficulty when drawing the bricks and detecting the colliaion b/w the bricks and the ball. I can not think of any way to draw more than one bricks with out testing for a ridiculous number of collisions.
I have a class for bricks, with properties such as visible, loccation, and the bounds, but i'm uncertain that this is the right approach.
I also need to have various levels in my game so I have a class for levels.
Any assistance is extremely comprehended,
View Replies !
drawing cursor tracking cross lines  (9 Views)

Private Sub Form1_MouseMoveDrawing(ByVal sender As Object ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
Dim g As Graphics = Me.CreateGraphics()
g.DrawLine(Pens.Blue, x1, e.Y, x2, e.Y) 'draw horizontal line
g.DrawLine(Pens.Red, e.X, y1, e.X, y2) 'draw vertical line
End Sub
Dim cursor_x, cursor_y As Decimal
Dim x1, y1, x2, y2 As Decimal
Dim std_width, std_height, std_x, std_y, old_x, old_y As Decimal
Dim balls As Integer
Private Sub graph_sizes()
std_width = Me.clientSize.Width * 0.9 'width of the main rectangle
std_height = Me.clientSize.Height * 0.9 'height of the main rectangle
std_x = Me.clientSize.Width * 0.01 'x cord of the main rectangle
std_y = Me.clientSize.Height * 0.01 'y cord of the main rectangle
x1 = std_x
x2 = std_x + std_width
y1 = std_y
y2 = std_y + std_height
End Sub
Private Sub Draw_cross_r_lines(ByVal g As Graphics)
'draw the rectangle
g.DrawRectangle(Pens.Black, std_x, std_y, std_width, std_height)
End SubWith these 3 subs (above) I can track the cursor movement with my window & can draw a horizontal & vertical lines from the location of the cursor. No difficulties there. Difficulty is I only wana one set of lines ( thus mimiking extended cross hairs) & what I receive is persistance. Previous line drawings, can't be deleted out & hence I receive a colouring paint effect in the rectangle. Great if u wana that, but I do not wana that. How do I negate that effect & draw only 2 lines that follow the cursor location
View Replies !
drawing an image to bmp and resize  (2 Views)
again.
I have an application that shows images (using picturebox component). what I'm attempting to do now is to try to let the user to resize the image how he wants it (scale). for this I guess I want to generate an instanece (bmp) clone of the selected image in the picturebox and draw it ontop of the original picture; then specifi new set of size points.
I was attempting to use the code snippet below:
Graphics.Fromimage(PictureBox1.image).BeginContainer('i do not know what to do here')I want to specifi the new size of the graphics container but I do not seem to have any clue on how can i do it.
View Replies !
Freehand drawing software  (2 Views)
QuoteWrite a program that allows the user to draw 'free-hand' images with the mouse in a PictureBox. Be sure to give the following:
A Button to let users to clear the image in the PictureBox
A ComboBox to let users to alter the color of the pen
A set of radio buttons to set the drawing width
A menu having at least the following items:
Clear
Alter Color (then give the colors that are in ur ComboBox)
Alter width (then give the sizes in ur RadioButtons)
Be sure that when the user makes a selection from the menu the appropriate control (Button, ComboBox or RadioButton) is edited to reflect the user's choice
View Replies !
circle drawing codes  (7 Views)
can I've codes of drawing a circle using visual introductory 2005
View Replies !
real-time sine curve drawing by vb.net2005 serialport  (3 Views)
i need to draw a real-time sine curve that coverted by LTC1274(12-bit A D).I've tried several timesbut i can not receive what i wana.Thank u for assist me.thank u Public Sub draw()
Try
With serialPort
.PortName = "com1"
.BaudRate = 19200
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.Encoding = System.Text.Encoding.UTF8
End With
Catch ex As Exception
End Try
serialPort.Open()

Try Dim b As Bitmap = New Bitmap(Me.picEMG.Width, Me.picEMG.Height,
Imaging.PixelFormat.Format32bppArgb)
'Dim c As Bitmap = New Bitmap(Me.picEMG.Width, Me.picEMG.Height, Imaging.PixelFormat.Format32bppArgb)
Dim G As Graphics = Graphics.Fromimage(B) >
G.Clear(Color.White)
G.TranslateTransform(20, Me.picEMG.Height 2)
Dim huabi As Pen
Dim bibi As Pen
bibi = New Pen(Color.Blue, 1)
huabi = New Pen(Color.Green, 4)

G.DrawLine(Pens.Blue, -20, -Me.picEMG.Height 2, -20, Me.picEMG.Height 2)
For x As Short = 66 To 4 * 66 Step 66
G.DrawLine(Pens.Blue, New Point(-20, -x), New Point(1200, -x))
Next
For x As Short = 66 To 4 * 66 Step 66
G.DrawLine(Pens.Blue, New Point(-20, x), New Point(1200, x))
Next

G.DrawLine(Pens.Blue, -20, 0, Me.picEMG.Width, 0)

Me.picEMG.image = bDo
Try

Dim i As Short = 0
Dim j As Short = 0
Dim lg(3) As Point
Dim buffer(8) As Byte
serialPort.Read(buffer, 0, 8)
Dim gs(6) As Int16
If buffer(0) = 255 And buffer(7) = 0 Then
k: gs(i) = buffer(i + 1)
i = i + 1
If i = 6 Then
i = 0
z: Dim n As Short = gs(i) * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 + gs(i + 1)
Dim lgpoint As New Point(y, -n 40)
lg(j) = lgpoint
j = j + 1
i = i + 2
y = y + 10
If i = 6 Then
GoTo huitu
End If
GoTo z
End If :
GoTo k

dim curvepoint As Point() = {lg(0), lg(1), lg(2)}
G.DrawCurve(bibi, curvepoint)[ color]
Me.picEMG.image = b
If y >= 1300 Then
'Me.picEMG.Refresh()
y = 20
GoTo l
End If
End If
GoTo s
Catch
End Try
Loop
Catch ex As Exception
End Try
End Sub

This post has been updated by PsychoCoder: 06 March 2008 - 08:19 AM
View Replies !