example of replacing draw material to render target with begin / end draw canvas to render target

hi

wondering if there is perhaps an example to replace draw material to render target
with begin draw canvas to render target
in particular how do you get the size right in draw material (target = canvas)

thanks

seems to work