added easier method to get width and height from canvas element