screen-capture

C# Capture screen to 8-bit (256 color) bitmap

China☆狼群 提交于 2019-12-04 17:49:45
I'm using this code to capture the screen: public Bitmap CaptureWindow(IntPtr handle) { // get te hDC of the target window IntPtr hdcSrc = User32.GetWindowDC(handle); // get the size User32.RECT windowRect = new User32.RECT(); User32.GetWindowRect(handle, ref windowRect); int width = windowRect.right - windowRect.left; int height = windowRect.bottom - windowRect.top; // create a device context we can copy to IntPtr hdcDest = GDI32.CreateCompatibleDC(hdcSrc); // create a bitmap we can copy it to, // using GetDeviceCaps to get the width/height IntPtr hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc

Efficiently read the average color of the screen content rendered by XBMC

我是研究僧i 提交于 2019-12-04 17:49:30
问题 I want to get the average color of the screen content when running XBMC to change the color of a TV ambient light. XBMC is running on a small HTPC with OpenGL ES 2.0 hardware (Raspberry Pi) running a Debian-derived distribution. I guess I have to read from the screen frame buffer in which XBMC draws using OpenGL. (At least, I think and hope that XBMC renders everything using OpenGL.) Is it possible to read the OpenGL frame buffer representing the whole screen output? What am I going to need

Android: Screencap to bytes directly - Skip saving to file

旧时模样 提交于 2019-12-04 15:51:50
I use the following code to take screenshot on a rooted device: sh = Runtime.getRuntime().exec("su", null,null); os = sh.getOutputStream(); os.write(("/system/bin/screencap -p " + "/sdcard/img.jpg" + "\n").getBytes("ASCII")); os.flush(); os.close(); sh.waitFor(); myBitmap = BitmapFactory.decodeFile("/sdcard/img.jpg"); As i want to take screenshots frequently, I don't want to first save it to the file and then read the bytes. Is there a better way to get the screenshot bitmap directly? I just wan't to eliminate this unnecessary delay. Thanks a lot! Update: The screencap.cpp code can be viewed

Alternative of xuggler for video encoding which doesnot require installaion? [closed]

﹥>﹥吖頭↗ 提交于 2019-12-04 13:15:49
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am creating a screencast Java Web Start application. Encoding Video using xuggler requires: installing xuggler on the client system - Which is tedious. (OR) Using xuggle-xuggler.jar version 5.2 or above whose size is around 35 MB plus. - this increases the time required for the application to load. Is there any other alternative in which installation is not required as well jars are not so huge. I

Capture multiple screens desktop image using Qt4

北城余情 提交于 2019-12-04 09:37:11
问题 i am writing a screen capture application in Qt4 with c++. I have a problem when tuning on dual screens. I am unable to get an image with the second screen. I tried a c# application and that will grab all the desktops in one image and i could extract from there each screen desktop image. Here is the c# code using System; using System.Drawing; using System.Runtime.InteropServices; public class TestGrab { [STAThread] static void Main(string[] args) { IntPtr hDC = WindowsNative.GetDC

API's for Android 4.4 screen recording?

陌路散爱 提交于 2019-12-04 08:46:05
问题 One of the features of Android 4.4 (Kit Kat) is that it provides a way for developers to capture an MP4 video of the screen using adb shell screenrecord . Does Android 4.4 provide any new API's for applications to capture and encode video, or does it just provide the screenrecord utility/binary? I ask because I would like to do some screen capture work in an application I'm writing. Before anyone asks, yes, the application would have framebuffer access. However, the only Android-provided

Capture Windows screen with ffmpeg

旧城冷巷雨未停 提交于 2019-12-04 07:44:02
问题 The ffmpeg is cross-platform and very powerful software to handle video/audio or to stream it. On Linux ffmpeg can capture X11 screen with a command below: ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpeg But is it possible to grab Windows Desktop with ffmpeg? 回答1: Use the built-in GDI screengrabber (no install needed) like this : ffmpeg -f gdigrab -framerate 10 -i desktop [output] This will capture ALL your displays as one big contiguous display. If you want to limit to a region, and show the

Screen Capture in andengine gives upside down mirror image

家住魔仙堡 提交于 2019-12-04 07:36:04
In my situation i haven't use RenderSurfaceView. I want to take a screen capture of my scene. But when i save the screen shot it shows upside down mirror image. Cant understand what im doing wrong here. Here is my code attachChild(screenCapture); share_clicked = 1; final int viewWidth = (int)camera.getWidth(); final int viewHeight = (int)camera.getHeight(); Log.d("camera width", "View width :" + viewWidth); Log.d("camera height", "View height :" + viewHeight); File direct = new File( Environment.getExternalStorageDirectory() + "/Word"); if (!direct.exists()) { if (direct.mkdir()) ; //

How to capture desktop screen of computer host where it's running on using node.js

泄露秘密 提交于 2019-12-04 03:11:05
Is there such a way to capture desktop with node.js not a browser tab? I have searched a lot but I didn't find any. What I want is to use node.js to build desktop application. You can use http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback and https://en.wikipedia.org/wiki/Scrot to make screenshot of screen of current user running nodejs application. Something like this (it is complete expressJS example): var express = require('express'), childProcess = require('child_process'), app = express(); app.get('/screenshot.png', function(request,response

How to capture window contents of a Windows Store App in C#

∥☆過路亽.° 提交于 2019-12-03 23:34:40
I have a bit of code to capture windows desktop app contents and save to a Bitmap object in .NET. It uses User32.dll and Gdi32.dll (BitBlt) and works just fine. However, the code produces all-black bitmaps when I give the code a handle to a window that holds a Windows Store app. I'm not sure if this is a security feature or what. I cannot use the ScreenCapture api as the contents of the window, after being resized, are almost always taller/larger than the screen. Has anyone had any luck capturing window contents even when they're larger than the screen, for a Windows Store app? EDIT: Just as a