Sounds like you are resampling an image to make it smaller or pixellate it, is that right?
Fastest way is to lock the bitmap into memory using Bitmap.LockBits(). Then you copy the data into an array and scan it with a loop.
This way is much harder to implement (if you are not used to this kind of thing) so you might find using Bitmap.GetPixel() easier until you get into the swing of things.
Good luck getting a detailed answer in the next 72 hours
im writing a mosaic design program ... need to split the bitmap into its various colours ... have been looking a GetPixel() too ... will check the above out ... many thanks illskills
if any one else knows of any useful imaging scripts/classes/functions etc would be most helpful
The way I did it was to lock the bitmap with lockbits, then get at the data with marshal.readbyte, and set it again with marshal.writebyte. Since then, I've found that it is faster to define an array to hold the colors and use marshal.copy to move all the data into the array.
Attached is the pixelate example modified that way (vb2005, I've not got 2003 to hand). If you have 2003 then open the form1.vb and then copy and paste the code into a new project (you'll need to set up the form controls manually, and clean up any 2005 specific stuff).
To get it faster (vb is limited, so code tweaks will only get it a bit faster) you would need to move to c# or c++. See Christian Graus' articles which are linked to here for a bit on processing in c# http://www.bobpowell.net/imageprocessing.htm
You may be interested to know that DoomSharp will eventually (when I finally get around to it) use this DMA (direct memory access) to do all of its graphical rendering at runtime. In tests I've managed to get performance in excess of the GDI+ libraries! MS aren't perfect after all