All the suggested methods seem to work, but I am not sure if there is anything I gain by using one over mine.

I can do some performance testing, because the code is actually used with some painting code, so speed will be somewhat important if there is a decent difference between the methods.