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

New Post: Is there any way to update all pixels at once using a byte array?

$
0
0
Is there any way to update all pixels at once using a byte array?
private void ApplyEffect(string parameter)
{
    try
    {
        int width = this.imageSource.PixelWidth;
        int height = this.imageSource.PixelHeight;

        byte[] pixels = this.magickImage.ToByteArray();
        IntPtr result = EffectsWrapper.ApplyEffect(parameter, pixels, width, height);
        if (result != IntPtr.Zero)
        {
            byte[] resultPixels = new byte[pixels.Length];
            Marshal.Copy(result, resultPixels, 0, pixels.Length);
            // I'm looking for something similar to this:
            // this.magickImage.SetPixels(resultPixels);
        }
    }
    catch (Exception exception)
    {
        MessageBox.Show(exception.Message);
    }
}

Viewing all articles
Browse latest Browse all 3693

Trending Articles



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