B4J Question jAWTRobot ScreenGetDimensions

ThRuST

Well-Known Member
Licensed User
Longtime User
Anyone knows how to use jAWTRobot's ScreenGetDimensions to get the current screen resolution for x and y? Thanks
 

Roycefer

Well-Known Member
Licensed User
Longtime User
The comments for that method describe how to use that method. It returns an array of Ints. The array will be twice the size of the number of monitors you have. The values will be in x,y pairs. For example, if you have a 1900x1200 monitor as your main monitor and a 1280x720 as your second monitor, you will get (1900,1200,1280,720) as a return value from that method.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
So what will the code be to get the screen resolution x,y from the primary monitor? Code snippet is warmly welcome :)
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
B4X:
Dim dims() As Int = lore.ScreenGetDimensions
Dim primaryWidth As Int = dims(0)
Dim primaryHeight As Int = dims(1)
 
Upvote 0
Top