JavaFX rotate screen 180° - javafx

I'm working on an application, that's going to be running on an embedded device, but I'm having problems, as the screen on the said device is mounted upside-down.
I found that I could do the rotate="180" in the FXML, but the thing is that drop down doesn't change and is still rotated.
Any idea how I should rotate the screen?
PS. Underlying OS is Linux, but it's not running any X servers, so I can't really rotate it OS wise.
PPS. Even when I do rotate it using xrandr, the framebuffer freaks out and doesn't render full frames, so I get the "old WinXP frozen app drawing" ability.

Related

Qt: Font is getting bigger for floating forms and undocked windows on 4K monitor

I am working on a existing Qt application and trying to support it on 4K monitor. For scaling the app, I am using "QT_SCREEN_SCALE_FACTOR" and scaling fonts based on logical DPI of screen. Everything is fine till this. Fonts for ribbon, docked windows are ok after scaling. But the font is getting too bigger for floating forms (pop up dialogs) and the docked widgets after undocking (the moment window is undocked, font is becoming bigger). I don't understand why this is happening. Is windows taking control over floating forms and making font bigger? Or am I missing something?
I am not using "Qt::AA_EnableHighDpiScaling" or "QT_SCALE_FACTOR" because I did not find these useful for me.
Has anyone faced this kind of problem?
Please let me know if someone knows about this.
After trying this and that, I found a solution to this problem.
I added'QGuiApplication::setAttribute(Qt::AA_DisableHighDpiScaling);' before creating QApp. And then I just needed to change the font size.

App suddenly does not respond to orientation change Xamarin.Forms

A while back, when we were first testing our app, the screen used to rotate when we tilted the phone. Even if the portrait formatting wasn't so great, it still responded to the orientation change.
I have no idea what happened between that point and this, but it no longer responds to orientation changes, at all. If I tilt the phone, it stays in portrait mode and does not rotate at all, the text does not align to the new orientation.
This is across all platforms, and I have the proper settings selected for each specific platform (in iOS in the info.plist, and in Android with the MainActivity decorations.)
The one thing I did do is that moved all of my screens from StackLayout-based to FlexLayout-based. But the screen SHOULD still rotate, or at least ATTEMPT to rotate, should it not? And this happens across all screens.
So ... if I may please could get some advice about what may be happening, here, that causes this behavior across all platforms?
It should be noted that we are also using Telerik libraries for many of our controls (but I don't know why it would make a difference.)
Also, it's a shared app.
Issue solved. Rotation was locked.

Qt Position offset Surface tablet

I have a program I designed for Desktop Applications for Windows with Qt MinGW 5.7. I was curious to see if it would work on a Surface tablet with Win10.
It does work, except for a small detail: eveything is offset. For instance, I grab the screen width with
"GetSystemMetrics(SM_CXSCREEN)" and I use this to place my window in the center of the screen. This works well on WinXp to Win10. However on a Surface tablet with Win10, everything is offset.
If I place an object at (0,0) it's fine but if I place it at (10,0), it will appear at (20,0).
What can I do ?
Thank you so much,
Alex
For the offset problem, I think it has to do with High-DPI scaling: http://doc.qt.io/qt-5/highdpi.html
But i'm not sure what to do to do it right.
Thanks,
Alex

JavaFX Screen size?

I'm using a PiTFT on my pi and running a JavaFX program. I got the output going to the PiTFT by running fbcp in the background.
I had to set disable_overscan=1 in /boot/config.txt to get it to show the whole image. That all works fine now.
My problem is that the touch screen calibration doesn't seem to effect JavaFX apps. The X and Y axis are swapped. Does anybody know how to calibrate the touch screen for JavaFX apps?
I don't know if this is a problem with the touchscreen driver for the PiTFT or a JavaFX configuration problem, so I'm going to post the same question to the adafruit forums and if I get an answer in one place, I'll copy it to the other.
I've struggled with the same problem today, and I managed to figure it out.
The PiTFT is by default a portrait display with a resolution of 240x320. The driver conf is originally made to rotate the display. The touchscreen setting for X are aware of that and have the rotate option set accordingly. And yes, this will not affect JavaFX since it doesn't run in X.
What I did:
in /boot/config.txt
disable_overscan=1
framebuffer_width=480
framebuffer_height=640
#set specific CVT mode
hdmi_cvt 480 640 60 1 0 0 0
#set CVT as default
hdmi_group=2
hdmi_mode=87
hdmi_force_hotplug=1
With this, the main display resolution is set to 480x640, and overscan is disabled.
Next, in /etc/modprobe.d/adafruit.conf, change the rotate option to be 0.
Save everything and reboot. Then fbcp & java Main, and it should be working OK.
Btw, be aware that I used the pre-built raspbian image from adafruit.

Can't seem to disable anti-aliasing in Android

I'm new to Android, and I've finished a game which was meant to feature pixel art. I was going to scale up my images (imageviews and bitmaps drawn to canvas) from small pixelated png files. The thing is, I could not seem to disable anti-aliasing whatever method I tried. The image was always blurred.
All my images are in one 'drawable' folder.
I tried android:antialias="false" within the ImageView in the xml.
Tried the method described here: http://www.41post.com/4241/programming/android-disabling-anti-aliasing-for-pixel-art
\
Tried changing the paint (paint.setAntiAlias(false)) when drawing the bitmap onto a canvas.
And even tried linking the ImageView to a xml bitmap drawable with antialias="false"
Am I missing something? In the end I had to just settle with leaving some images blurry and having the big images as big images and not resizing in the xml file.
From the Hardware Acceleration Guide, it looks like Paint#setFilterBitmap() is always enabled and cannot be disabled when hardware acceleration is enabled. Try checking to see if your app is using hardware acceleration.
I've seen similar behavior in the emulator when enabling the "Use host GPU" option, and found that a device that didn't have the anti-aliasing behavior could be forced to have that behavior by using Paint#setFilterBitmap(true). I was not able to disable the behavior in the emulator though without disabling the host GPU option.

Resources