How mdpi, hdpi, xhdpi folder works?

You can create different graphic objects for use at different pixel densities. Android treats mdpi (160 pixels/inch) as the base density. So for mdpi devices, 1 dp = 1 pixel. At higher densities, there are more pixels per inch (240 for hdpi, 320 for xhdpi). Android attempts to make graphic images occupy the same physical … Read more

C# Method Resolution, long vs int

The int version of bar is being called, because 10 is an int literal and the compiler will look for the method which closest matches the input variable(s). To call the long version, you’ll need to specify a long literal like so: foo.bar(10L); Here is a post by Eric Lippert on much more complicated versions … Read more

How can I get the resolution (width and height) for a video file from a linux command line?

Use ffprobe (part of FFmpeg toolkit) example: ffprobe -v quiet -print_format json -show_format -show_streams ~/Movies/big_buck_bunny_720p_5mb.mp4 output: { “streams”: [ { “index”: 0, “codec_name”: “h264”, “codec_long_name”: “H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10”, “profile”: “Main”, “codec_type”: “video”, “codec_time_base”: “1/50”, “codec_tag_string”: “avc1”, “codec_tag”: “0x31637661”, “width”: 1280, “height”: 720, “coded_width”: 1280, “coded_height”: 720, “has_b_frames”: 0, … Read more

CamcorderProfile.QUALITY_HIGH resolution produces green flickering video

I came across this question trying to solve the same problem. A solution is given over on xda developer http://forum.xda-developers.com/showthread.php?t=1104970&page=8. It seems that you need to set an obscure parameter “cam_mode” for high definition recording to work: camera = Camera.open(); Camera.Parameters param = camera.getParameters(); param.set( “cam_mode”, 1 ); camera.setParameters( param ); In mediarecorder, you can … Read more

Changing DPI scaling size of display make Qt application’s font size get rendered bigger

High DPI support is enabled from Qt 5.6 onward. Setting QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling) in your application source code allows automatic high-DPI scaling. NOTICE: To use the attribute method, you must set the attribute before you create your QApplication object: #include <QApplication> int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); return app.exec(); }