473,387 Members | 1,497 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.

lines drawing

I want to plot the lines in the form automatically by
retrieving the values of X and Y coordinates from the
Access database.The X and Y fields in my access database
has about 50 or more records.I would request you to please
provide me the coding as I'm new to this VB.net.
Please help me.
Thanking You.
Nov 20 '05 #1
2 1087
This is the code I was using in generation of linear picture of number
PI.

It will show you how I read file for certain numbers of Pi and how I
draw the lines.

All you have to do is to rework this so you read your own values from
access database. I hope someone else will help you with that part
soon.

This is the code, and don't forget to put picturebox on to your form:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
'Draw line on picturebox
'Put a picturebox on the form named pic
Button1.Visible = False
Static start_time As DateTime
Static stop_time As DateTime
Dim elapsed_time As TimeSpan

start_time = Now

Dim bit As Bitmap = New Bitmap(pic.Width, pic.Height)
Dim g As Graphics = Graphics.FromImage(bit)
Dim bb, x, x1, x2, x3 As Integer
Dim width As Integer
Dim height As Integer
Dim width1 As Integer
Dim height1 As Integer
Dim myPen As Pen

' textbox2.text has a path to my number pi file

Dim fs = New FileStream(TextBox2.Text, FileMode.Open,
FileAccess.Read)
Dim r As New BinaryReader(fs)
Dim koniec As Integer = (Math.Round(fs.length) /
2) - 2
x3 = 100
While x3 <= 255 And bb < koniec
x3 = x3 + 1
While x2 <= 255 And bb < koniec
x2 = x2 + 1
StatusBar1.Text = koniec - bb
While x1 <= 255 And bb < koniec
x1 = x1 + 1
While x <= 255 And bb < koniec
x = x + 1
bb = bb + 2
myPen = New Pen(Color.FromArgb(x3 - 1,
x2 - 1, x1 - 1, x - 1), 1)
width = r.ReadByte()
height = r.ReadByte()
g.DrawLine(myPen, 0, width, 256,
height)
End While
x = 0
End While
x1 = 0
End While
x2 = 0
End While
x3 = 0

r.Close()
fs.close()

pic.Image = bit
pic.Image.Save(OpenFileDialog1.FileName +
".png")
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
StatusBar1.Text = "Calculation length in seconds:
" +
elapsed_time.TotalSeconds.ToString("0.000000")

Button1.Visible = True
End Sub

vjay
backup at www.dotnetboards.com

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 20 '05 #2
"Vishruth" <ra************@rediffmail.com> schrieb
I want to plot the lines in the form automatically by
retrieving the values of X and Y coordinates from the
Access database.The X and Y fields in my access database
has about 50 or more records.I would request you to please
provide me the coding as I'm new to this VB.net.
Please help me.
Thanking You.


HELLO? Please read the answers you got. Please answer the questions.
--
Armin

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

Nov 20 '05 #3

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

Similar topics

0
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
5
by: Brian | last post by:
Hello all.. Am working on an Air Hockey game... have an table loaded into a picture box. The borders of the table are slightly slanted. Am using hit testing lines with GDI+ to manipulate the...
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...
6
by: charindal | last post by:
i am trying to create a program that is able to draw a housing plan. the user should be able to input the required meters then upon clicking a left,right,up, down button, the system draws a line in...
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: 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: 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: 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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.