Extract drawing code