Efficient way to create and access bitmap data

J

James Dean

I am reading in a certain file format and it is compressed with Run
Length encoding. To output to the screen i convert this to a 24bpp
bitmap. The problem is when the data is decompressed its big and the
program is very slow.....any functions in C# to help with this......

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tamir Khason

The only thing can be recommad to is to try using method:
Bitmap.LockBits(
Rectangle rect,
ImageLockMode flags,
PixelFormat format
);

It returns BitmapData with Scan0 property which returns
memory address of first byte of bitmap data.
....but from here becomes "UNSAFE" mode with pointers.

But, If You want to work with files and streams then
make sure to get those files specification (if they
have any compression or particular byte direction?)
Good thing is to start with small files e.g. 16x16.

Usually if there's no compression, image data lies
at the end part of file. So if you know its size then
you can easily gets its bytes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top