Paint function now uses get_arguments

Has not been tested. Possible problem caused by endianess.