high-resolution

HiDPI support in Java Swing for multiple look and feels

蓝咒 提交于 2021-02-06 12:59:08
问题 I'm looking to add Hi-DPI support to some Swing applications, but I have failed to find a solution sufficient to my needs. I need to support multiple look & feels, so the situation seems rather more complex than other posts I've found (which tend to suggest "adapt your UI sizes to match your font size"). Some experimentation has found the UIManager contains many metrics that can be tweaked to get you off to a good start in making an application Hi-DPI friendly. (The UIManager-Defaults utility

high resolution timer in android for metronome

不打扰是莪最后的温柔 提交于 2020-06-27 18:36:30
问题 I'm trying to create a metronome for Android, and I wrote this code to play a beep at 300BPM using a SoundPool, but it tends to skip beats sometimes and creates lag. I have researched, and all of the answers I have found don't solve my issue. This especially happens when I try to speed up the bpm count or use eighth notes instead of quarter (double time). Can someone guide me in the right direction of making this as accurate as possible? Delay/beat-skipping is not acceptible . Thanks!! final

Windows Forms and High DPI Screens

末鹿安然 提交于 2020-02-04 04:49:23
问题 I have an Outlook Add In called TMO (http://gotmo.co.uk) which has a Windows Form that is opened on the click of the Help Button in the Outlook toolbar. The problem is that when I use TMO on High DPI Screens such as Surface Pro the form renders very convoluted (see screenshot). However on other laptops the form renders correctly. In fact if I run a test app on Surface Pro from where I load the same form it renders correctly. See the attached screenshots. From my reading so far Windows Forms

High Resolution Timing Part of Your Code

末鹿安然 提交于 2020-01-29 05:14:11
问题 I want to measure the speed of a function within a loop. But why my way of doing it always print "0" instead of high-res timing with 9 digits decimal precision (i.e. in nano/micro seconds)? What's the correct way to do it? #include <iomanip> #include <iostream> #include <time.h> int main() { for (int i = 0; i <100; i++) { std::clock_t startTime = std::clock(); // a very fast function in the middle cout << "Time: " << setprecision(9) << (clock() - startTime + 0.00)/CLOCKS_PER_SEC << endl; }

How to get [UIImage imageWithContentsOfFile:] and High Res Images working

佐手、 提交于 2019-12-29 18:01:09
问题 As many people are complaining it seems that in the Apple SDK for the Retina Display there's a bug and imageWithContentsOfFile actually does not automatically load the 2x images. I've stumbled into a nice post how to make a function which detects UIScreen scale factor and properly loads low or high res images ( http://atastypixel.com/blog/uiimage-resolution-independence-and-the-iphone-4s-retina-display/ ), but the solution loads a 2x image and still has the scale factor of the image set to 1

Limits of Windows Queue Timers

℡╲_俬逩灬. 提交于 2019-12-24 11:15:05
问题 I am implementing a timer and need it to run every 50 ms or so and would like the resolution to be 1 ms or less. I started by reading these two articles: http://www.codeproject.com/Articles/1236/Timers-Tutorial http://www.virtualdub.org/blog/pivot/entry.php?id=272 Oddly enough they seem to contradict one another. One says queue timers are good for high resolution, the other posts results from a Windows 7 system showing resolution around 15ms (not good enough for my application). So I ran a

Save space: Batch resize down all @2x images for old iPhones/iPads/iPods on first launch

元气小坏坏 提交于 2019-12-24 09:46:10
问题 The issue with this: iphone 4 - loading images x old devices is that we end up filling our apps with double content. Ie a user has to download both the 2x size and the 1x sized image to his device, but will eventually only use one of them and the other one will be a waste of download time etc. So I thought, in some cases it could be okay with just filling your app with the high res images (@2x), and on app launch (in the app delegate, before displaying the window... or something), you could

OpenCV 3.2 with Python 3 VideoCapture changes settings of v4l2

有些话、适合烂在心里 提交于 2019-12-24 08:48:54
问题 I worked with OpenCV 3.2 with Python3 and SBC OXU4. I have a true 5MPx web-camera connected to SBC. I want to take from this camera 2592x1944 resolution picture. If I use Cheese I can take picture with this resolution. I can save pictures with command line program streamer -t 4 -r 4 -s 2592x1944 -o b0.jpeg But when I take picture with OpenCV3.2 like this: #!/usr/bin/env python3 import cv2 import os import time capture1 = cv2.VideoCapture(2) if capture1.isOpened(): capture1.set(3, 2592)

Different and wrong size of a WinForms form on high-resolution screen in VS IDE and exe

一世执手 提交于 2019-12-22 01:16:07
问题 I am developing a C# WinForms app for .NET 4.0 in VS 2017 on my ASUS NV552 laptop with UltraHD monitor with 282ppi. To work comfortably, I set the system scale factor to 300% in my Windows 10 Pro Creators Update. When I compile and launch the project, the size of the form differs from what I see in the VS Designer and it seems, .NET stops recalculating the form size at all for big form sizes. For instance, when the form's Size property is set to 1606; 1284 in the VS property browser, the

Change camera resolution setting programmatically in android

旧时模样 提交于 2019-12-21 04:56:08
问题 I'm using the below code to open the camera. Is it possible to set the camera resolution to high programmatically? private void openDefaultCameraApp() { Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(i, CAPTURE_PHOTO_CONSTANT); } 回答1: You must add an MediaStore.EXTRA_OUTPUT to the intent. In the extra, you have to specify a Uri for the picture to be saved to. This will save the full resolution image, otherwise, it will just snap a small image.