Results 1 to 8 of 8

Thread: 6 Dimensional Array

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2013
    Posts
    1

    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.

  2. #2
    Lively Member
    Join Date
    May 2009
    Location
    UK
    Posts
    72

    Re: 6 Dimensional Array Problems

    Quote Originally Posted by -=Te[]v[]eR=- View Post
    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.

  3. #3
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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)

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: 6 Dimensional Array

    Post moved from the VB6 Forum to the VB.Net forum.

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    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

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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!

  7. #7

    Re: 6 Dimensional Array

    Quote Originally Posted by dunfiddlin View Post
    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!

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: 6 Dimensional Array

    Quote Originally Posted by dunfiddlin View Post
    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.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width