Can you please check if there's some memory allocation issue with .Negate() filter as I am having the following problem.
I load an image into MagickImage. I have 2 Picturebox - one always showing the original image, the 2nd showing altered image after filters. For speed concerns I simply clone the Original image to a Processed image, don't load the image again from the file.
After applying a .Negate() the Original image gets changed just like the Processed one. This happens only with Negate filter, many other filters I used work just fine. Also this doesn't happen if I don't clone the Original to the Processed image, but load the Processed image from the file again..
I don't know if this is issue with Negate filter, or I am doing something wrong...
Here's my code:
I load an image into MagickImage. I have 2 Picturebox - one always showing the original image, the 2nd showing altered image after filters. For speed concerns I simply clone the Original image to a Processed image, don't load the image again from the file.
After applying a .Negate() the Original image gets changed just like the Processed one. This happens only with Negate filter, many other filters I used work just fine. Also this doesn't happen if I don't clone the Original to the Processed image, but load the Processed image from the file again..
I don't know if this is issue with Negate filter, or I am doing something wrong...
Here's my code:
Class MyClass
Private OriginalImage As MagickImage
Private ProcessedImage As MagickImage
Private Sub Test()
'load the original image
OriginalImage = New MagickImage("image.jpg")
' display the original image
PictureBox_Original_Image.Image = OriginalImage.ToBitmap
' clone the original image to the processed one
ProcessedImage = OriginalImage.Clone
' do some filters
ProcessedImage.Negate()
' show the processed image after the filters
PictureBox_Trainer_Processed_Image.Image = ProcessedImage.ToBitmap
' redisplay the original again to show there's problem with the .Negate filter
PictureBox_Trainer_Original_Image.Image = OriginalImage.ToBitmap
End Sub
End Class
Thanks in advance for your help!