|
-
Jun 19th, 2013, 05:45 PM
#1
Thread Starter
New Member
6 Dimensional Array
Hi All,
Well I also have similar problem, where data from objects properties is very time sensitive. I am trying to store a pixel with 5 more or attributes, and then form a new array based on the rules controlling any of the attributes.
Would you still recommend file database if I had excessive amount of RAM (solid state) and multiprocessor system ?
Could you please give an example how to fill up a 6 dimensional array with simple rules in VB? Much appreciate if you could, this is a hobby, although
I know that VB is not best for graphic programming, at the moment I am trying to understand the logic of how to be an efficient programmer and will learn other language later.
This is where I am at so far :
'Reading pixels from picture and displaying their color values
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ' Has one Picturebox, one ListBox and one button
ListBox1.Items.Clear()
ListBox1.Items.Add("Pixel Color Factor")
Dim img As Bitmap = New Bitmap(PictureBox1.Image) 'Storing jpg
Dim c As Color 'Extracting color
'Dim myPolygon(,,,,) As Integer How does this work ?
Dim countPix As Integer = 0 'Pixel counter
Dim writer As System.IO.StreamWriter
writer = System.IO.File.CreateText("myRecs.Txt")
TextBox2.Text = "W: " + img.Width.ToString + " H :" + img.Height.ToString 'Displaying pictures size in pixels
Dim j As Integer = 0
Do While (j < img.Height) 'Reading rows from jpg
Dim i As Integer = 0
Do While (i < img.Width) 'Reading columns from jpg
Dim valPix As Integer = 0
c = img.GetPixel(i, j)
Dim a As Integer = Convert.ToInt16(c.A)
Dim r As Integer = Convert.ToInt16(c.R)
Dim g As Integer = Convert.ToInt16(c.G)
Dim b As Integer = Convert.ToInt16(c.B)
valPix = Convert.ToInt16(c.R) + Convert.ToInt16(c.G) + Convert.ToInt16(c.B) 'Calculating sum of colors. I think we can call that brightness
'listing raw data x,y,amount of red,green and blue
ListBox1.Items.Add((i.ToString + ("," _
+ (j.ToString + (" " _
+ (r.ToString + (" " _
+ (g.ToString + (" " + b.ToString) + (" " + valPix.ToString)))))))))
'writing formated data for later use
writer.WriteLine("Index :" + countPix.ToString + " X : " + i.ToString + " Y : " + j.ToString + " Red : " + r.ToString + " Green : " + g.ToString + " Blue : " + b.ToString)
writer.WriteLine(" ")
i = (i + 5) 'High resolution image requires serious processing power, skipping 5 columns and 5 rows
countPix = (countPix + 5)
Loop
j = (j + 5)
Loop
writer.Close()
End Sub
Thank your for your time.
-
Jun 19th, 2013, 09:16 PM
#2
Lively Member
Re: 6 Dimensional Array Problems
 Originally Posted by -=Te[]v[]eR=-
Hi All,
... Thank your for your time.
Please dont hijack a users post, create a new post for yourself, so we may assist you. Thanks.
-
Jun 20th, 2013, 12:21 AM
#3
Re: 6 Dimensional Array Problems
@ asymetrix
It looks like SuperDave00 won't be coming back anymore; see his OP's time-stamp. 
@ -=Te[]v[]eR=-
It appears you're using VB.Net. I've asked the moderators to move your post to the proper forum.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 20th, 2013, 03:09 AM
#4
Re: 6 Dimensional Array
Post moved from the VB6 Forum to the VB.Net forum.
-
Jun 20th, 2013, 09:38 AM
#5
Re: 6 Dimensional Array
It doesn't look to me like you want a 6 dimensional array, it looks like you want a class with 6 member variables. That would be a whole lot easier to work with, too.
My usual boring signature: Nothing
 
-
Jun 20th, 2013, 10:12 AM
#6
Re: 6 Dimensional Array
6 dimensions? So that would be like a collection of collections of collections of collections of collections of collections all of one data type in a hyper-hyper-hypercube? I'm just off to a darkened room with a damp cloth.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jun 20th, 2013, 10:20 AM
#7
Re: 6 Dimensional Array
 Originally Posted by dunfiddlin
6 dimensions?  So that would be like a collection of collections of collections of collections of collections of collections all of one data type in a hyper-hyper-hypercube? I'm just off to a darkened room with a damp cloth. 
I can't even wrap my head around the dimensions required. I'm still trying to get used to the fact that I see in 3 dimensions!
-
Jun 20th, 2013, 11:07 AM
#8
Re: 6 Dimensional Array
 Originally Posted by dunfiddlin
6 dimensions?  So that would be like a collection of collections of collections of collections of collections of collections all of one data type in a hyper-hyper-hypercube? I'm just off to a darkened room with a damp cloth. 
Actually its more like having multiple levels of nested indexes to a single item.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|