Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9193981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:17:39+00:00 2026-06-17T21:17:39+00:00

I have VB 2008 code that searches through individual pixels of a section of

  • 0

I have VB 2008 code that searches through individual pixels of a section of a grayscale bitmap image. If the pixel values are less than 72, I want to store the coordinates of the pixel in a two dimensional array.

When I run my code I get the following error: “Value of type ‘integer’ cannot be converted to ‘two dimensional array of integer’.

My code is shown below. This code is in a loop that gets the indivdual pixel values. Any suggestions on what I’m doing wrong?

Dim bpCoordinates(,) As Integer
Dim yindex As Integer
Dim xindex As Integer
'If pixel value is < 72, store in array
'Framenumber and y are the integer values of the pixel coordinate
'xindex and yindex are the index values for the array that I want to store the coordinates in
If pixelValue < 72 Then                    
    bpCoordinates = (FrameNumber, y  xindex,yindex )
    yindex = yindex + 1
    xindex = xindex + 1
End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:17:40+00:00Added an answer on June 17, 2026 at 9:17 pm

    If you want to simply save the list of Pixel coordinates, you’d be much easier off with more advanced data types, like

       Dim pixelList As New List(Of Point)
       ...
       pixelList.Add(New Point(xValue, yValue))
    

    Arrays are much work to care about. You have to initialize the Array before the loop with something like

    ReDim bpCoordinates(1, 0)  
    

    And in the loop something like

        n = n + 1
        ReDim Preserve bpCoordinates(1, n)
        bpCoordinates(0, n) = Framenumber
        bpCoordinates(1, n) = y
    

    The first dimension stays from 0 to 1 (to store two values) and cannot be changed. Read about ReDim Preserve if you’re confused about this 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a piece of code that creates an SQL Server Express 2008 in
I have the code that compiled on Visual Studio 2008 in 32 bit mode.
I have the following C/C++ code that I'm compiling with Visual Studio 2008: struct
I have been told that Singletons are hard to test. http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/ I have
I have code that compiles fine with VC9 (Microsoft Visual C++ 2008 SP1) but
I have the following code that needs to be ported to Visual Studio 2008.
I have some code that iterates through files in a directory and does useful
I am using Visual Studio 2008 Code Coverage and I have many classes that
VS 2008 I have this code snippet I found on a VB website. But
Visual Studio C++ 2008 I have the following code in my server.h file. #if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.