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

  • Home
  • SEARCH
  • 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 6677671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:09:02+00:00 2026-05-26T04:09:02+00:00

i have big problem with explanation code under, meanwhile i made two loops function

  • 0

i have big problem with explanation code under, meanwhile i made two loops function which does the same thing. I send my code to friend to tell me if it is possible to make is simplier 🙂 So i get something like that.

Array.Copy(
    myImageData
        .Select(
            (b, index) =>
                (
                    index > rooflimit && index < floorlimit && b == 252 &&
                    (myImageData[index + width] == 0 || (myImageData[index + width] > 168 && myImageData[index + width] < 173)) &&
                    myImageData[index - width] == 252 &&
                    myImageData[index - (2 * width)] == 159
                ) ? (byte)172 : b
        ).ToArray(),
    rooflimit + 1,
    myImageData,
    rooflimit + 1,
    floorlimit - rooflimit - 1
);

My loops was doing something like that (above do the same thing):

  1. when you get all pixelse, copy them to array of bytes
  2. find all pixels which have value 255, pixel under has 0 or it is from range 168-173
  3. pixel above has value 255 and pixel 2 times above has value 159
  4. if i found that pixel change that value to 172
  5. * pixel checking starts from the second row [0][1][2], and finish before last row, to be able check pixels above and under of current pixel *

I get almost about that code above, however i don’t understand that part which starts with:

rooflimit + 1, 
myImageData, 
rooflimit + 1, 
floorlimit - rooflimit - 1);

So i ask you for a help, thanks!
PS. please change topic if it is not good specified.

  • 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-05-26T04:09:02+00:00Added an answer on May 26, 2026 at 4:09 am

    The last four parameters are the last parameters to Array.Copy. Your code would be clearer if you split it up:

    byte[] tmp = myImageData.Select([... big lambda expression ...])
                            .ToArray();
    
    Array.Copy(tmp, rooflimit + 1, 
               myImageData, rooflimit + 1,
               floorlimit - rooflimit - 1);
    

    I would also be very tempted to use a separate method instead of a lambda expression here – it’s too complicated to be readable, really.

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

Sidebar

Related Questions

I have big problem. Lets look on the code below: protected void Application_AuthenticateRequest(object sender,
I've created a form with code and I have a big problem. Every element
I have a big lump of binary data in a char[] array which I
I have a big problem with my SMTP server for sending emails. It's down
I really seem to have a big problem here. I'm using MySQL to store
I'm using sqlalchemy. The question is simple, but I have a big problem, because
Good day, Stackoverflow! I have a little (big) problem with porting one of my
I have big problem with reading big numbers from excel in java. When i
The Android documentation being the mess that it is, I have big problem understanding
I have a big problem with the PHP DOMDocument::validate() who seems to ask the

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.