473,383 Members | 1,788 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

drawing lines

I would like to know how to plot coordinates in the form
using drawline method .For eg: Given only x and y fields
and about 50 records are there in database .I should fetch
the records from database and plot it in the form given
only x and Y coordinates.
please help me to tackle this problem.
Nov 20 '05 #1
2 1551
"Vishruth" <ra************@rediffmail.com> schrieb
I would like to know how to plot coordinates in the form
using drawline method .For eg: Given only x and y fields
and about 50 records are there in database .I should fetch
the records from database and plot it in the form given
only x and Y coordinates.
please help me to tackle this problem.


Pseudo-Code:

sub render(g as graphics)

for
g.drawXYZ
next

end sub

In OnPaint, call
render(e.graphics)

Outside OnPaint (inside the Form):

dim g as graphics
g = me.creategraphics
try
render g
finally
g.dispose
end try

See also:
http://msdn.microsoft.com/library/en...tingimages.asp
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
I Didnt have time to finish this, but its almost there. . .

Me.CON = New System.Data.OleDb.OleDbConnection
'
'CON
'
Me.CON.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Documents and
Settings\Administrator\My Documents\" & _
"FamilyPlusFriends.mdb"";Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0" & _
""";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security
info=False;Ext" & _
"ended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt
Database=False;Jet OLED" & _
"B:Create System Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet " & _
"OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet
OLEDB:Global Bulk T" & _
"ransactions=1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(392, 357)
Me.Name = "Form1"
Me.Text = "Form1"

End Sub

#End Region

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Me.CON = New System.Data.OleDb.OleDbConnection
'
'CON ( The Connection to the access Database )
'
Me.CON.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=1;Data Source=""C:\Documents and
Settings\Administrator\My Documents\" & _
"FamilyPlusFriends.mdb"";Jet OLEDB:Engine
Type=5;Provider=""Microsoft.Jet.OLEDB.4.0" & _
""";Jet OLEDB:System database=;Jet OLEDB:SFP=False;persist security
info=False;Ext" & _
"ended Properties=;Mode=Share Deny None;Jet OLEDB:Encrypt
Database=False;Jet OLED" & _
"B:Create System Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet " & _
"OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet
OLEDB:Global Bulk T" & _
"ransactions=1"
Dim SQLStr As String = "Select * From PLOT"

Dim myCommand As New OleDb.OleDbCommand(SQLStr, CON)
CON.Open()
Dim blackPen As New Pen(Color.Black, 10)

' Draw line to screen.
Dim g As Graphics = Me.CreateGraphics()

Dim lastX, lastY As Integer
RDR = myCommand.ExecuteReader()
' Always call Read before accessing data.
While RDR.Read()

g.DrawLine(blackPen, lastX, lastY, RDR.GetInt32(0),
RDR.GetInt32(1))

lastX = RDR.GetInt32(0)
lastY = RDR.GetInt32(1)
End While
' always call Close when done reading.
RDR.Close()
' Close the connection when done with it.
CON.Close()

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: T. F. | last post by:
Hi, I need to create a box / field that the user can draw into (with some kind of pen). I also need to know how I can edit the size of the pen style and how I can "transport" the drawn image...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
0
by: borhan | last post by:
I am designing a program in which the user will be drawing, lines, circules and so on, on a paint control which displays an image opened by the user. "It's like there is a map on the picturebox...
8
by: Benoit Martin | last post by:
I had to draw my own control because I couldn't find any control doing what I wanted it to do. This control has a grid that I need to have control over. To do that, I draw each line of the grid...
2
by: George | last post by:
Dear colleagues, I refer to your help with specific graphic problem. It is necessary to create a viewfinder in graphic application. It seems that the algorithm is simple: just draw lines in...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
4
by: Galen Somerville | last post by:
My VB2005 app gets real time Heart sounds and an ECG from a USB device. I'm looking for a way to speed up the drawing of the traces on the screen. In the following code the routine GetSounds...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've windows form, in this form i've a panel. I want to draw lines inside the panel using the panel coordinates( meaing that the left upper corner of the panel is 0,0), how can i do it? ...
1
by: YouPoP | last post by:
I am doing an app (C# 2.0) where you can draw in a panel with your mouse in "real time". I actually have 2 problems; 1- it does not really is "real time", if your mouse move fast or very fast the...
5
by: Macias | last post by:
Hi, Please help me, how I can make a line drawing on PictureBox similar to MS paint. I thinking about this: click and hold button, move mouse and relase button. I'm trying useing this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.