On Nov 27, 5:44 am, Ruby Nadler <RubyNad...@discussions.microsoft.com>
wrote:
Hi Nicholas,
what i am trying to do is cut b&w image (like newspaper page) into columns
and rows according to its layout.
any idea?
thanks.
AFAIK, you can manipulate images efficiently by using unsafe code
regions and pointer arithmetics. There is a simple example in C# 3.0
in a Nutshell which I remember:
unsafe void RedFilter(int[,] bitmap)
{
int length = bitmap.Length;
fixed (int* b= bitmap)
{
int* p = b;
for(int i = 0; i < length; i++)
*p++ &= 0xFF;
}
}
This kind of iteration over a bitmap avoids runtime index checking and
runtime type checking as you would have by accessing the bitmap via
[x,y]
hth,
-- Henon
my site:
http://www.eqqon.com