I have an Int Ptr which is pointing to some 32-bit image data in memory, which holds an unsigned 32-bit number (not rgb, just 32-bit components). Normally Int's are signed.
I want to read this unsigned number in and do math with the correct unsigned value.
If I do this:
and if the value being read is more than 2^31-1, surely it will read it as some negative number, and then when casting it as a Long it will just make it a long version of that negative number, rather than preserve the unsigned value?
How can I read the Int, and only the Int (without having to read a Long from memory), and get the unsigned value into a Long?
I want to read this unsigned number in and do math with the correct unsigned value.
If I do this:
Local MyIntPtr:Int Ptr=BasePtr+Xpos+(Ypos*PixelsPerRow) Local a:Long=Long(MyIntPtr[0])
and if the value being read is more than 2^31-1, surely it will read it as some negative number, and then when casting it as a Long it will just make it a long version of that negative number, rather than preserve the unsigned value?
How can I read the Int, and only the Int (without having to read a Long from memory), and get the unsigned value into a Long?