WriteableBitmap Class provides a BitmapSource that can be written to and updated, and the whole picture is one, which causes the color of the image to be affected by the Canvas background. When the background of Canvas becomes green, red and green are superimposed, so the red pattern becomes yellow.
To do this, when you change the background of Canvas, you could traverse the pixels of the entire picture, and if you find a pixel block that is not red, then change it. Please refer to the second reply of this question.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…