change: re-write formats for draw actions.

Signed-off-by: liuyanghejerry <liuyanghejerry@126.com>
fix: `fs.truncate` is not working in node 0.10.24 any more. Changed to `fs.writeFile`.

Signed-off-by: liuyanghejerry <liuyanghejerry@126.com>