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 6376253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:43:16+00:00 2026-05-25T01:43:16+00:00

I have a huge array of points to draw on a canvas. Right now

  • 0

I have a huge array of points to draw on a canvas. Right now i am drawing every point by running a nested loop for x and y on the array of the data. This seems to be causing firefox to show a script has hanged notice.

What would be the best way to avoid that?

IMO some kind of parallel looping solution would be great, but the problem is i am not aware of any such method.

  • 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-25T01:43:17+00:00Added an answer on May 25, 2026 at 1:43 am

    If you’re just creating an image pixel by pixel, you’re way better off doing it in an “image data” object and then dropping that into the canvas when you’re done. It’s much, much cheaper to drop pixels into an array than it is to make canvas API calls pixel-by-pixel.

    There’s a method called “createImageData()” that you use to make an ImageData object, which is really just an array of pixels with height/width. The pixels are organized as a simple linear array, with each group of four array elements representing a single pixel. The four values are just the red, green, and blue color values, and an alpha value for opacity.

    When your code has filled in all the pixel values, you just call “putImageData()” to draw it to the canvas.

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

Sidebar

Related Questions

I have a huge data set and I have to compute for every point
I have to huge array of 2D-points and some small associated data to file.
I have a huge array, which I loop with a foreach. foreach ($items as
I have a huge array of 2D points (about 3 millions of pairs), which
I have a huge global array of structures. Some regions of the array are
I have a huge text file which I want to explode into an array.
I have huge data which is static. I need to save it within the
I have huge amont of geographic data represented in simple object structure consisting only
I have a huge array list which contains 1000 entries out of which one
I have an huge array which contains a struct Tile. The program im writing

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.