added support to define pixel ratio with Canvas constructor