Creating canvas through code