473,387 Members | 1,465 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,387 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 1553
"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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.