Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Lock/Unlock bits emulation

$
0
0
Hello

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?

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>