Check all the variants the documentation of newImageData. Note that none of the forms accepts a size followed by a filename. The closest is newImageData(filename), which doesn't need the size because it's encoded in the file itself.
Last edited by pgimeno on Fri Jan 08, 2016 7:21 pm, edited 1 time in total.
Yes, the three-argument version of newImageData accepts raw imagedata as the third argument.
In your case, you want the one-argument version, which accepts a filename.
In my first version of the post I asked if you were sure that you needed newImageData rather than newImage. Then I realized it was actually for an icon, not for drawing it yourself, so I deleted that part because for an icon, you need newImageData indeed.