screen

Scale a rectangle in html and css

不打扰是莪最后的温柔 提交于 2019-12-12 03:33:41
问题 I want to make a rectangle (a div) with a specific scale. The height-width scale has to be 30:50. The rectangle fills 40% of the width-screen. If I resize my screen, how can I change the height if you keep the scale in mind? HTML: <div id="bg"> </div> CSS: #bg { background-color: blue; width: 40%; } 回答1: Try scaling it using vw (viewport width): #bg { background-color: blue; width: 40vw; height: 66.67vw; } https://jsfiddle.net/gmsitter/9tpbq30x/1/ 来源: https://stackoverflow.com/questions

Print screen without JFrame

删除回忆录丶 提交于 2019-12-12 02:56:14
问题 I want to do a print screen behind a JFrame who i call source. But the JFrame(source) itself not and print it in another JFrame, who i call destiny... like the picture in the link: https://drive.google.com/file/d/0B4iWj2t4ATQ5ZllwVEE0M1BxUnc/view?usp=sharing I tried to use setVisible(false) and after setVisible(true) but i don't want it closes and open again. How I do it? Here is my actual code: package tests; import java.awt.*; import java.awt.image.BufferedImage; import javax.swing.JFrame;

unlock screen while in call android

微笑、不失礼 提交于 2019-12-12 02:55:04
问题 How to prevent the screen from getting locked while in call. While in video call after the timeout the screen gets locked. I notice its not the case in normal android phones that we use. Can someone provide the code to keep it unlocked while in call??? 回答1: http://developer.android.com/reference/android/os/PowerManager.html Change PowerManager WakeLock setting. 来源: https://stackoverflow.com/questions/10383204/unlock-screen-while-in-call-android

Android display Dimensions and Drawable size scaling

本小妞迷上赌 提交于 2019-12-12 02:52:14
问题 It is the next stage of: Scale and align in custom android AnalogClock hands ...this one. Soon I realized that a Drawable can not be scaled, if it fits the size box, then it will be displayed. Otherwise not. So now I need a Bitmap to scale it and then convert back to Drawable and draw it. It doesn't seem elegant, but according to what I found, I don't see any other way. (Idea is to create own alarm app with some special tricks. Firstly, I need clock hands. For creating custom clock, I used

Android - How to prevent the phone screen from turning on when volume or camera key is pressed?

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:35:13
问题 I have an activity that shows up when the phone screen goes to sleep/turns off ie turns black. For some reason, the phone turns on when the volume buttons or the camera buttons are pressed. By turns on, I mean the screen wakes up or comes back from the black screen state. I've tried using dispatchKeyEvent(KeyEvent event) and the buttons are disabled on the activity, but they still wake up the phone. 回答1: You could try overriding the onKeyDown(KeyEvent) method and change what happens for those

Number of pixels of screen python

那年仲夏 提交于 2019-12-12 01:23:16
问题 How can I calculate the number of pixels in screen (width, height) with python? I want it to be adaptable to any screen, is this possible? 回答1: Borrowing from this question: How do I get monitor resolution in Python?, there are several options. Here's one with Tkinter: import Tkinter as tk root = tk.Tk() screen_width = root.winfo_screenwidth() screen_height = root.winfo_screenheight() print screen_width * screen_height # (e.g.) 3686400 = 2560*1440 That other post has a lot of different ways

UIScrollView UIPangestureRecognizer dead zone on top edge of screen

好久不见. 提交于 2019-12-12 00:52:31
问题 as shown in the picture below the UIPanGestureRecognizer will not pan when the drag started inside the "dead zone" on the top of the screen. This is most likely caused by the notification center. The touchesMoved:withEvent: method however does get called, so there should be a way to get pan gestures recognized in this area. Has anyone else came across this issue, are there any workarounds out there yet? Thanks for any help! 回答1: It is possible that on the top edge of the screen you have

Gdk / X11 Screen Capture

二次信任 提交于 2019-12-12 00:20:58
问题 I want to write a program that continuously captures the screen and does some modifications to the image. A complete test program can be found at: https://gist.github.com/blogsh/eb4dd4b96aca468c8bfa However, I ran into some problems. The first experiment I did was using the Gdk root window, create a Cairo context from it and then using it's target as the source for another window, where the contents are painted to: mScreenContext = Gdk::Screen::get_default()->get_root_window()->create_cairo

ncurses, print and contemporary acquire strings

梦想与她 提交于 2019-12-11 21:24:15
问题 A program written in C uses ncurses . A while cycle is used to continuously check if a new message is arrived in a queue: if it is, the message is printed on screen and then removed from the queue: while (condition) { if (queue_not_empty) { printw(element_from_queue); refresh(); remove(element_from_queue); } } At the same time, however, the program should be able to acquire an input string from the user and then store it in the array char message[100] through a scanw . But if I put while

Android SurfaceView: Better way to tell if screen is touched (java)

不想你离开。 提交于 2019-12-11 21:12:42
问题 I need a way to tell if there is at least one finger touching the screen. I had no problem doing this in LibGDX but now I can't do it without it. This is how I have it setup: public static boolean screenTouched = false; //This methods is run at 60FPS by the main thread (it's the main game loop) public static void update(){ //Run other updates... screenTouched = false;//Called after other updates } public boolean onTouchEvent(MotionEvent e){ screenTouched = true; } By the way, this is all in