I might be missing the obvious, but nothing in your code seems to set "scaledsimage", which will remain a null pixmap and produce nothing out at line 19.