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

Wacom Ink SDK for Devices - Windows, Android and iOS (also known as the CDL)
dileepiscalling
Posts: 1
Joined: Wed 12. Feb 2020, 12:34

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

Postby dileepiscalling » Wed 12. Feb 2020, 12:42

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.

RicoMos
Posts: 1
Joined: Thu 17. Dec 2020, 22:52

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

Postby RicoMos » Thu 17. Dec 2020, 22:58

Hi,
I got exactly the same issue, did you finally find the way to change it?
Thanks

squatapple
Posts: 1
Joined: Tue 12. Apr 2022, 12:13

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

Postby squatapple » Tue 12. Apr 2022, 12:26

Did anyone found solution for this ? pls share will be very helpful .

WacomInkDev2
Posts: 18
Joined: Thu 19. Nov 2020, 06:17

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

Postby WacomInkDev2 » Thu 14. Apr 2022, 16:52

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);


Return to “SDK for Devices”