I know that this is the same issue as
http://en.sfml-dev.org/forums/index.php?topic=14861.0, but it does not seem to be answered by an official developer and it lacks some clarification.
The issue is that a two-dimensional array of colors can't get properly converted into an image.
Allow me to show an example:
int width
= 128;int height
= 128;Color
[,
] pixels
= new Color
[width, height
];for (int x
= 0; x
< width
; x
++){ for (int y
= 0; y
< height
; y
++) { pixels
[x, y
] = new Color
((byte)x,
0,
(byte)y
); }}Image img
= new Image
(pixels
); This code should create a gradient that gets red to the right and blue to the bottom.
But against my expectations, it gets red to the bottom and blue to the right.
If the width and height variables don't have the same values, the results look a little different.
Example with width 73 and height 200: