screen

Android apply styles for different screens

瘦欲@ 提交于 2019-12-05 21:17:50
问题 I have an application, that need to run in 2 different devices: 600x1024 & 480x800 . For these devices, I want to apply different styles (they has different ratio). How I can do it, as both of them has hdpi?, e.g. values-hdpi , values-mdpi have no effect.... P.S. Android 2.2 . 回答1: Take a look at the available resource directory qualifiers. There are also screen size qualifiers you can use. In your case you need the large and xlarge qualifiers. Try that. 来源: https://stackoverflow.com

Android: programmatically get position of the widget on desktop relative to other widgets

北城以北 提交于 2019-12-05 20:39:35
On Android the user can place a widget on the desktop and then to move it by long touch and moving the finger while still holding. Is it possible to programmatically get the position on the screen where the widget was moved by long touch? I need my desktop widget to know if it's near the edge of the screen of the device. Depending on whether it's on the top of the desktop or at the bottom different layouts for the widget will be chosen. I would expect that this position is not given in pixels, but as pair of 0-based indexes. E.g. if the device can display 4x7 cells on the desktop, the widget

Tmux 简介与使用

时光怂恿深爱的人放手 提交于 2019-12-05 19:27:46
Tmux 是一个用于在终端窗口中运行多个终端会话的工具,即终端复用软件(terminal multiplexer)。在 Tmux 中可以根据不同的工作任务创建不同的会话,每个会话又可以创建多个窗口来完成不同的工作,每个窗口又可以分割成很多小窗口。这些功能都是非常实用的。 Tmux 的多窗口和窗口分割并不是它吸引的我原因,对于这一点我可以有另外一个终端工具代替,即 Terminator。 使用 Tmux 最大的益处在于,远程 SSH 访问服务器进行工作时 。即使非正常掉线,它能保存当前工作状态,并保证当前任务继续运行。这一点对于远程 SSH 工作的人来说是非常重要的。远程 ssh 工作时,Tmux 的多会话、多窗口、多面板的益处才充分体现了出来。使用 Tmux 就不必开启多个标签连接多个 ssh 了,所有工作在一个 ssh 连接上就搞定了,也不必担心突然掉线后工作丢失。 与 Tmux 类似的软件还有 screen、dvtm、splitvt、byobu 等。 会话, 窗口, 窗格 根据 Tmux 的定义,在开启了 Tmux 服务器后,会首先创建一个会话,而这个会话则会首先创建一个窗口,其中仅包含一个窗格;也就是说,这里看到的所谓终端控制台应该称作 Tmux 的一个窗格,虽然其使用方法与终端控制台完全相同。 Tmux 使用 C/S 模型构建,主要包括以下单元模块: server 服务器

Qt: printscreen key in keyPressEvent

让人想犯罪 __ 提交于 2019-12-05 19:11:28
When I pressing keys, this code works, but not with Print Screen key. void KeyHooker::keyPressEvent(QKeyEvent *event) { qDebug() << event->key(); } Q. How can I grab Print Screen key? The problem is that the OS grabs this before it reaches your code: http://qt-project.org/forums/viewthread/18610/#90901 You'll need to use Microsoft's LowLevelKeyboardProc in your code to do this: http://msdn.microsoft.com/en-us/library/ms644985%28v=VS.85%29.aspx 来源: https://stackoverflow.com/questions/27002328/qt-printscreen-key-in-keypressevent

Refresh table control after action

断了今生、忘了曾经 提交于 2019-12-05 18:53:05
I have a screen with a table control in it (generated with the Screen Painter) that shows records from a database table. The screen also has a button, which shows a popup when it's clicked. The popup has a form to add a record to the database table. When the form is submitted the record is added to the database, but when the popup is closed, the screen that shows the database records isn't refreshed i.e. the new record isn't shown. Simply calling the screen again doesn't seem to work. How to refresh the table control to show the new record? You have to make sure that the data that you want to

Android / Java: Show GUI on “off-screen” (Always-On Display…)

戏子无情 提交于 2019-12-05 18:41:22
I saw new Android devices coming out, that show things (clock etc.) once the display "turns off". That feature is called an Always-On Display, and since my Samsung Galaxy S6 edge already features an AMOLED screen, and a night-clock, I believe there is a way, to make it show something, when the display is "turned off". Is there a way using Java on Android, to display something, once display is meant to turn off? (Like just a normal GUI, I could do the rest then.) Like, to tell your app, to show something, when the screen turns off, that is still visible somehow? (without root permissions) That

Received memory warning when capturing screen and save to video ios

落爺英雄遲暮 提交于 2019-12-05 17:18:05
I am now writing a program to capture screen and convert to video. I can successfully save the video if it is less than 10 seconds. But, if more than that, I received memory warning and application crash. I wrote this code as follow. Where am I missing to release data ? I would like to know how to do. -(void)captureAndSaveImage { if(!stopCapturing){ if (assetWriterInput.readyForMoreMediaData) { keepTrackOfBackGroundMood++; NSLog(@"keepTrackOfBackGroundMood is %d",keepTrackOfBackGroundMood); CVReturn cvErr = kCVReturnSuccess; CGSize imageSize = screenCaptureAndDraw.bounds.size; CGFloat

Android: Turn screen on and off without locking

[亡魂溺海] 提交于 2019-12-05 17:10:48
I need to turn the screen off and on like when you are doing a call and holding the phone to your ear. The screen then turns off but it isn't locked or anything, it's just black. What is the best way to do that? I don't want to show a black fullscreen activity if there is another solution...:) There are two methods for doing that, PowerManager manager = (PowerManager) getSystemService(Context.POWER_SERVICE); // method 1 manager.goToSleep(int amountOfTime); // method 2 PowerManager.WakeLock wl = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Your Tag"); wl.acquire();// It will swith off

Getting screen size on OpenCV

自作多情 提交于 2019-12-05 16:19:21
问题 How do I get the computer screen resolution on OpenCV? I need to show two images side by side using the whole screen width, OpenCV requires the exact window size I wanna create. 回答1: You can use this solution cross-platform solution with or without opencv: #if WIN32 #include <windows.h> #else #include <X11/Xlib.h> #endif //... void getScreenResolution(int &width, int &height) { #if WIN32 width = (int) GetSystemMetrics(SM_CXSCREEN); height = (int) GetSystemMetrics(SM_CYSCREEN); #else Display*

how to prevent screen record in ios11

送分小仙女□ 提交于 2019-12-05 16:03:46
To some reasons, our APP dont't want people record screen, but in ios11 a new feature can let user record there iphone screen, so is there an API or notification indicate me user is recording now thank u very much You can detect if the screen is being recorded with: UIScreen.main.isCaptured // True if this screen is being captured (e.g. recorded, AirPlayed, mirrored, etc.) You can't prevent it using project settings, but you could use a modal or something to request the user to disable it. Not sure how that might workout with your AppStore submission. 李国立 You can use kvo observe