Skia example code not writing an image
This never writes anything to the output file because you haven't included any code to write to the output file. The only time you touch the file after opening it is in the line

png-&gt;MakeFromFILE(pFile);


which reads from the file into the SkData instance. It won't even do that in this case, because the file handle has to be open for reading only.

I'm no expert on Skia, but you probably want to use SkFILEWStream to write the file. Or just call png.bytes() and write the bytes to the file using the standard library.