Page 1 of 1

How to change orientation to portrait mode in android sample app - bamboo slate

Posted: Wed 12. Feb 2020, 12:42
by dileepiscalling
Hi, I am using the sample android app present at Wacom github - https://github.com/Wacom-Developer/will ... es-android

I am using bamboo slate to test the android app.
I couldn't find any code or reference in their sample app codebase to change the orientation of the bamboo slate to portrait mode.
By default whatever I write on the slate, it appears only in landscape mode in the app.

I couldn't even find the option to change orientation in their documentation.
Their inkspace app has an option to change the orientation. So I guess, it supports that option in their sample app/sdk too.

Someone please shed some light on this - how to change the orientation in their android sdk/sample app.
Banging my head from 3 days to do this.

Re: How to change orientation to portrait mode in android sample app - bamboo slate

Posted: Thu 17. Dec 2020, 22:58
by RicoMos
Hi,
I got exactly the same issue, did you finally find the way to change it?
Thanks

Re: How to change orientation to portrait mode in android sample app - bamboo slate

Posted: Tue 12. Apr 2022, 12:26
by squatapple
Did anyone found solution for this ? pls share will be very helpful .

Re: How to change orientation to portrait mode in android sample app - bamboo slate

Posted: Thu 14. Apr 2022, 16:52
by WacomInkDev2
Hello

I hope the information below will help - if not let me know.
Kind regards
Wacom Ink Dev 2

The coordinates returned by the Hardware are x from top to down and y from right to left. Then you can use a transformation matrix to transform the coordinates as you desire to adjust to your screen:

canvasWidth = height;
canvasHeight = width;

float wScale = width / (float) app.noteHeight;
float hScale = height / (float) app.noteWidth;

float sf = wScale < hScale ? wScale : hScale;

Matrix matrix = new Matrix();
matrix.postRotate(90);
matrix.postTranslate(app.noteWidth, 0);
matrix.postScale(sf, sf);

liveModeDeviceService.setTransformationMatrix(matrix);