473,378 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Performance problems

I am wondering is there an easier way to save memory than splitting a
whole image into blocks. If the block is white then it takes up no
memory basically at all and so storing image data in an array of blocks
is efficient. But i am thinking with C# there must be a less complicated
way.....At the moment i have 1bpp data stored in an array to tell me if
a bit is turned on or off. I only deal with 4 colors so i create a new
1bpp byte array for each color and then create my bitmap by seeing which
colors are set in each array and displaying one 24bpp bitmap from
that.If colors overlap i set it to an average color. I take it that this
clone method will be useful to clone only the rectangle that the
graphics region needs at any time. So maybe is my best option to only
draw the graphics rectangle thats needed by the program each time rather
than creating the full bitmap and then returning parts of that all the
time?. I would like some expert advice if u can advise me whats best to
do.
Thanks in advance.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1127
Hi James,

If you fight with performance problem then you should choose the one:
a) more speed, more memory
b) less speed, less memory

Second option is usually accomplished by a image compression.
I am wondering is there an easier way to save memory than splitting a
whole image into blocks. If the block is white then it takes up no
memory basically at all and so storing image data in an array of blocks
is efficient. But i am thinking with C# there must be a less complicated
way.....
This algorithm looks like Q-TREE (or OCT-TREE in 3D).
But i'm affraid that csharp doesn't have any support for
this algorithm in a standard version.
At the moment i have 1bpp data stored in an array to tell me if
a bit is turned on or off. I only deal with 4 colors so i create a new
1bpp byte array for each color and then create my bitmap by seeing which
colors are set in each array and displaying one 24bpp bitmap from
that.If colors overlap i set it to an average color. I take it that this
clone method will be useful to clone only the rectangle that the
graphics region needs at any time. So maybe is my best option to only
draw the graphics rectangle thats needed by the program each time rather
than creating the full bitmap and then returning parts of that all the
time?.
I think, that it depends on how fast the changes occures in your data.
A second way, is to refresh only changed area (as you mentioned),
eg. by its extend (rectangle).
You should keep (at least) one buffer (eg. 24bpp Bitmap) for
displaying purposes.
I would like some expert advice if u can advise me whats best to
do.


Hey experts!
Join this thread ;)

Cheers

Marcin
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric S. Johansson | last post by:
more questions about performance measurements in python. I solve the problems I had with shelf by not using it. I'm doing a direct pickle to and from file of an entire dictionary. That knocked off...
6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
12
by: serge | last post by:
I have an SP that is big, huge, 700-800 lines. I am not an expert but I need to figure out every possible way that I can improve the performance speed of this SP. In the next couple of weeks I...
5
by: John Bailo | last post by:
I wrote a webservice to output a report file. The fields of the report are formatted based on information in an in-memory XmlDocument. As each row of a SqlDataReader are looped through, a...
5
by: Scott | last post by:
I have a customer that had developed an Access97 application to track their business information. The application grew significantly and they used the Upsizing Wizard to move the tables to SQL...
24
by: Bob Alston | last post by:
Most of my Access database implementations have been fairly small in terms of data volume and number of concurrent users. So far I haven't had performance issues to worry about. <knock on wood> ...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
5
by: Markus Ernst | last post by:
Hello A class that composes the output of shop-related data gets some info from the main shop class. Now I wonder whether it is faster to store the info in the output class or get it from the...
2
by: Chris | last post by:
We have an asp application some of which will be being ported over to asp.net so this may be a little OT. It is having some bad performance problems and we need to isolate which areas are causing...
0
by: Chris | last post by:
We have an asp application some of which will be being ported over to asp.net so this may be a little OT. It is having some bad performance problems and we need to isolate which areas are causing...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.