If it was possible to set values in script (like dimensions), then use bmap_process and paint on the bitmap according to those values, then that would be the fastest way I assume.
I haven't tried that in a long time but I think the material/ effect only receives those values once per frame. Maybe it's possible to use some directX function? I don't know.
Should you try that and figure it out, please tell me the results.