use imagedata to draw image