Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Error in documentation source code

Last post 20 Jun 2007, 2:16 PM by loufranco. 1 replies.
Sort Posts: Previous Next
  •  11 May 2007, 9:35 AM 12000

    Error in documentation source code

    Hello,

    The C# code at

    https://www.atalasoft.com/products/dotimage/docs/AccessingPixelData.html



    has an error.

    The correct code would be this:

     

    PixelMemory pm = image.PixelMemory;
    using (PixelAccessor pa = pm.AcquirePixelAccessor())
    {
    for (int y=0; y < image.Height; y++)
    {
    byte[] row = pa.AcquireScanline(y);
    for (int i=0; i < row.Length; i++)
                /// YOU NEED A CAST HERE 
                row[i] = (byte)  row[i] / 2; // dim each byte value by 50%

    }
    pa.ReleaseScanline();
    }
    }

     

  •  20 Jun 2007, 2:16 PM 12224 in reply to 12000

    Re: Error in documentation source code

    Thanks -- we will get this into our docs soon.
View as RSS news feed in XML