Ok I managed to do step 1-3.
I use Image Tools PNG Encoder to encode my canvas to a memory stream, and then create a byte array from it.
And now my problem is on how to save the byte array to a png file in the server?
I tried using filestream, the file was created, but when i try to open it, it said something's wrong about the file format.
Anyone knows how to fix this? Thanks.