Click here to Skip to main content
15,896,467 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am processing small images in an Application. For each pixel I need to store an integer between 40 and 90. I don't know how large the image is until runtime and in a session several images may be processed. I am thinking of using a datatable because it's easy but if an image is 400X500 that means adding 400 columns and 500 rows. A 3d array or list is good but the object needs to be public and resized after an image is loaded. A matrix is a possibility too. The big issue is resizing the object at runtime. I might write it out to a temp csv file and reload it when I need it. Suggestions please.

What I have tried:

Writing it out and arrays but can't resize public arrays at runtime
Posted
Updated 9-Oct-19 15:44pm

1 solution

400 x 500 = 200,000.

Using 1 byte to store the "int" (cast as a byte), your "structure" is 200KB, which in my experience is trivial.

Even if you used "int", until you get to "multi-megabyte" structures, there's nothing to be concerned about.

Program first, tune later (within reason).
 
Share this answer
 
Comments
larry118 10-Oct-19 0:14am    
Are you saying I resize a 1 D array to 200,000 at th time?
larry118 11-Oct-19 10:23am    
It turns out the majority of processing time is taken up by drawing the grid around the characters not processing the image. I use drawline to draw the grid first vertical then horizontal.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900