I am writing a bit of code that processes an image of the user’s choice such as it’s size.
However when I call the code, the variable of the original image, I keep if things such as reverting need to be done, is changed as well.
This is a short example of the code that I have for this
private void ProcessInputImage()
{
Image processImage = new Image();
processImage = originImage;
processImage .Resize(588, 816);
}
This code also changes the size of originImage, but I don’t want this.
How do I make it so that I can set processImage to originImage every time the method is called, but originImage never changes with the functions of this method?
I have other code running that does change originImage when the user chooses a different image from their drive so I can’t make it read-only.
Also, I am porting this to android so using
processImage.Load(path);
won’t work, since the plugin retrieves an image, not it’s path
(Besides it’s less optimized that way)