Hello
I need to iterate through the all pixels of the image and make some actions with each pixel.
For example:
Can anyone provide me an example how I can get a pointer to the buffer that contains the bitmap data in memory(IntPtr) to work on with it?
I need to iterate through the all pixels of the image and make some actions with each pixel.
For example:
BitmapData data = image.LockBits();
int stride = data.Stride;
int bpp = data.BitsPerPixel / 8;
byte* scan0 = (byte*)data.Scan0.ToPointer();
for (int y = 0; y < image.Height; y++)
{
for (int x = 0; x < image.Width; x++)
{
// some actions
pos += bpp;
}
}
image.UnlockBits(data);
But looks like Lock/Unlock bits functionality has not implemented yet for Magick.NET.Can anyone provide me an example how I can get a pointer to the buffer that contains the bitmap data in memory(IntPtr) to work on with it?