This is a little module I just made while learning how to use the Reflection library. I was interested in the GetRotation method of the Display class. But I added two more methods: GetRefreshRate and GetPixelFormat, just for completion.
I couldn't make GetRectSize or GetSize to work, but that's not very important, since there are other ways to get that info (via GetDeviceLayoutValues for example).
There are 2 variation of the Subs. The second one should be faster, because it doesn't need to retrieve the display each time, since it's a costly process. This way if you need to call these functions several times, you can retrieve the display at the beginning by calling getDefaultDisplay() and pass it as an argument to the second variation of the sub.
Theses are the Subs in the module:
Attached is a full example, that uses the documented module. It obviously needs Reflection Library installed.
enjoy!
I couldn't make GetRectSize or GetSize to work, but that's not very important, since there are other ways to get that info (via GetDeviceLayoutValues for example).
There are 2 variation of the Subs. The second one should be faster, because it doesn't need to retrieve the display each time, since it's a costly process. This way if you need to call these functions several times, you can retrieve the display at the beginning by calling getDefaultDisplay() and pass it as an argument to the second variation of the sub.
Theses are the Subs in the module:
B4X:
getDefaultDisplay() As Object
getPixelFormat() As Int
getPixelFormat2(display As Object) As Int
getRefreshRate() As Int
getRefreshRate2(display As Object) As Int
getRotation() As Int
getRotation2(display As Object) As Int
Attached is a full example, that uses the documented module. It obviously needs Reflection Library installed.
enjoy!