Returns the bitmap data stride (scan line width in bytes).
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public ReadOnly Property Stride As Integer
public int Stride { get; }
Aurigma.GraphicsMill.BitmapData bitmapData = bitmap.LockBits();
unsafe
{
byte* pos;
byte* scan0 = (byte*)(bitmapData.Scan0.ToPointer());
int stride = bitmapData.Stride;
int widthInBytes = bitmapData.Width * bitmapData.BitsPerPixel / 8;
int height = bitmapData.Height;
for (int j = 0; j < height; j++)
{
pos = scan0 + stride * j;
for (int i = 0; i < widthInBytes; i++)
{
*pos = (byte)(255 - *pos);
pos++;
}
}
}
bitmap.UnlockBits(bitmapData);