Ah, understood. Thanks for the nice code explanation and references... they both really help.
canvas_setcurrent(x_canvas);
int dzero = canvas_getdollarzero();