Exception 'ImageElement' is not a subtype of type 'CanvasElement'

If the source of the BitmapData is of type ImageElement, we have the exception "type 'ImageElement' is not a subtype of type 'CanvasElement' of 'canvas'" when we use it in a GraphicsPattern.
Merge pull request #56 from xavierhainaux/patch-2

Exception 'ImageElement' is not a subtype of type 'CanvasElement'