WritePixelsBuffer error

I may be dumb but this doesnt seem right.

I was trying the WritePixelsBuffer but it kept on saying that the buffer length wasnt matching the size.
I tried multiple methods, setting the EditableImage size before making the buffer, making a vector2 for both EditableImage and buffer, subtracting or adding to see if its a few bytes off.
None worked.

Error being given:

Buffer:

1 Like

I think you need to initiate it with editImage.Size.X*editImage.Size.Y*4 instead of imageSize.X*imageSize.Y*4

Basically the buffer size needs to match the dimensions of the editable image object, not the image label that is rendered on.

Sorry for the confusion.
the imageSize variable is a vector2 used on both the EditableImage.Size and the Buffer.

I at first used the EditableImage.Size on the Buffer but wanted to check if setting a vector2 beforehand would work, it didnt