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);
}
}