I have an odd scenario (see this answer for more details), where I need to add two bytes of data together. Obviously this is not normal adding. Here is the scenario:
I am trying to get a coordinate out of a control. When the control is less that 256 in width then the x coordinate takes one byte, otherwise it takes two bites.
So, I now have an instance of that control that is larger than 256 in width. How do I add these two numbers together?
So for example:
- 2 + 0 is not 2 because the 2 is the high byte (or maybe it is the low byte and it is 2...)
Am I making sense? If so, how can I do this kind of addition in C#?
Update: Sorry for the confusing question. I think I got it figured out. See my answer below.