screenshot

screen sharing in python

故事扮演 提交于 2020-05-25 05:19:40
问题 Hi I'm stuck and I did not find anything helpful on the internet. I'm trying to make a screen-sharing program in python. The problem is that I can't send the screen in at least 24 fps, because when I take a screenshot with PIL (ImageGrab), something delays there. my client will get the picture (screenshot) from the server and "blit" it to the screen using pygame. Server: # -*- coding: utf-8 -*- import socket import os import threading from PIL import ImageGrab def RetrFile(name, sock): while

Capturing screenshots with win32api python returns black image

ぃ、小莉子 提交于 2020-05-16 03:24:45
问题 I've used the following code examples to capture a screenshot: https://stackoverflow.com/a/3260811 https://stackoverflow.com/a/24352388/5858697 When taking a screenshot of Firefox or chrome, they return a blank black image. Capturing a screenshot of notepad works fine. I've done some research on this and I think it's because they're gpu accelerated. Other screenshot libraries work but I need to have it so I can capture a screenshot of an application even if it's not currently visible. Has

How to take screenshot in OpenGL

拥有回忆 提交于 2020-05-09 09:56:42
问题 How to take a screenshot of an OpenGL window in C++ and save it to file. I found the glReadPixels() function, but I don't know what to do next. Where I can set path to a file, for example? If not difficult, write code, please. 回答1: This piece of code captures the OpenGL window and export to a BMP file. You must have FreeImage library to run it. // Make the BYTE array, factor of 3 because it's RBG. BYTE* pixels = new BYTE[3 * width * height]; glReadPixels(0, 0, width, height, GL_RGB, GL

How to take screenshot in OpenGL

爷,独闯天下 提交于 2020-05-09 09:56:29
问题 How to take a screenshot of an OpenGL window in C++ and save it to file. I found the glReadPixels() function, but I don't know what to do next. Where I can set path to a file, for example? If not difficult, write code, please. 回答1: This piece of code captures the OpenGL window and export to a BMP file. You must have FreeImage library to run it. // Make the BYTE array, factor of 3 because it's RBG. BYTE* pixels = new BYTE[3 * width * height]; glReadPixels(0, 0, width, height, GL_RGB, GL

How to take screenshot in OpenGL

大兔子大兔子 提交于 2020-05-09 09:56:29
问题 How to take a screenshot of an OpenGL window in C++ and save it to file. I found the glReadPixels() function, but I don't know what to do next. Where I can set path to a file, for example? If not difficult, write code, please. 回答1: This piece of code captures the OpenGL window and export to a BMP file. You must have FreeImage library to run it. // Make the BYTE array, factor of 3 because it's RBG. BYTE* pixels = new BYTE[3 * width * height]; glReadPixels(0, 0, width, height, GL_RGB, GL

Python screenshot 2+ monitors (windows)

為{幸葍}努か 提交于 2020-03-18 12:03:45
问题 How to make a screenshot with python, if connected to multiple monitors? I tried: import sys from PyQt4.QtGui import QPixmap, QApplication app = QApplication(sys.argv) QPixmap.grabWindow(QApplication.desktop().winId()).save('test.png', 'png') import ImageGrab im = ImageGrab.grab() im.save('test.png', 'PNG') Both options provide a screenshot, only the primary monitor If I use winapi: hWnd = win32gui.FindWindow(None, win_name) dc = win32gui.GetWindowDC(hWnd) i_colour = int(win32gui.GetPixel(dc

Taking screenshot of WKWebview with hardware accelerated content

冷暖自知 提交于 2020-03-17 11:41:24
问题 I am having serious trouble with taking screenshot of WKWebview content when there is hardware accelerated content (some specific casino games that are running inside iframe). So far I used the standard way of taking screenshot like everyone suggests: UIGraphicsBeginImageContextWithOptions(containerView.frame.size, true, 0.0) containerView.layer.render(in: UIGraphicsGetCurrentContext()!) //This line helps to fix view rendering for taking screenshot on older iOS devices containerView

Take Screenshot of a UIImage iOS

僤鯓⒐⒋嵵緔 提交于 2020-02-29 06:30:07
问题 I want to take screenshot of a perticular section of my screen in a iOS App. The attached image is that part of screen. Here I want to take screenshot of the red marked rectangular area containing 3 UIImageViews which contains a white Image Frame at background , an image with coffee cup and the apple sign image on the coffee respectively. I am using the following code for doing that... - (UIImage *)captureView:(UIView *)view withArea:(CGRect)screenRect { UIGraphicsBeginImageContext(screenRect

Take Screenshot of a UIImage iOS

天大地大妈咪最大 提交于 2020-02-29 06:29:37
问题 I want to take screenshot of a perticular section of my screen in a iOS App. The attached image is that part of screen. Here I want to take screenshot of the red marked rectangular area containing 3 UIImageViews which contains a white Image Frame at background , an image with coffee cup and the apple sign image on the coffee respectively. I am using the following code for doing that... - (UIImage *)captureView:(UIView *)view withArea:(CGRect)screenRect { UIGraphicsBeginImageContext(screenRect

Can I screenshot or printscreen with a console application without excess references

偶尔善良 提交于 2020-02-27 02:22:43
问题 I was wondering if there is a way to screenshot your desktop with a console application without having to call Windows.Forms and call the SendKeys class. Because I just created a compiler and it can only compile pure C# Console applications, it doesnt work if you add a reference because its going to throw you a few error See this link (My question with an answer on codeproject) and I want to create a console application which can take screenshots when I want it to. 回答1: I use this class to do