gdi

Screen Capture Specific Window

泄露秘密 提交于 2019-12-17 19:39:01
问题 Is it possible to screen capture a specific window (also possibly of another process)? Currently I am capturing the entire desktop of a specific monitor, however what I truly want is to capture the content of a specific window (regardless of its position). 回答1: Yes it is. All what you need is get handle to window which you want to capture and use WinAPI function PrintWindow for example: // Get the window handle of calculator application. HWND hWnd = ::FindWindow( 0, _T( "Calculator" )); //

How can I detect if a thread has windows handles?

血红的双手。 提交于 2019-12-17 19:31:20
问题 How can I programmatically detect if a thread has windows handles on it for a given process? spy++ gives me this information but I need to do it programmatically. I need to do this in C#, however the .net diagnostics libs don't give me this information. I imagine spy++ is using some windows api call that I don't know about. I have access to the code of the system I'm trying to debug. I want to embed some code called by a timer periodically that will detect how many thread contain windows

What's the upper limit on GDI objects for one process in Windows 7?

梦想与她 提交于 2019-12-17 09:43:45
问题 Have an application with a GDI leak that will eventually hit 10,000 allocated GDI objects and crash. I tried increasing the GDIProcessHandleQuota to 20,000, but the program still crashed when it reached 10,000 objects. We're currently working on patching this leak, but out of curiosity--is there a way to increase the GDI limit for a single process? Or is 10k an individual application's hard limit? 回答1: There is a solution that might work. I deal with a misbehaved vendor's app here that

Graphics.DrawString vs TextRenderer.DrawText?Which can Deliver Better Quality

六月ゝ 毕业季﹏ 提交于 2019-12-17 06:38:25
问题 TextRenderer is based on GDI and Graphics.DrawString is based on GDI+.Which of these functions can deliver better quality text while drawing text on an image. 回答1: Just my 2 cents: I always use Graphics.DrawString, except when I need to do custom painting for my (Windows Forms) controls. For example in a listbox that has OwnerDraw set, if I attach a DrawItem event handler that fully paints items, including item text. Or in a custom control I have to paint myself. In an application that uses

Problem reading JPEG Metadata (Orientation)

ⅰ亾dé卋堺 提交于 2019-12-17 02:28:51
问题 I've got a JPEG image which was taken on an iphone. On my desktop PC (Windows Photo Viewer, Google Chrome, etc) the orientation is incorrect. I'm working on an ASP.NET MVC 3 web application where i need to upload photos (currently using plupload). I've got some server-side code to process images, including reading EXIF data. I've tried reading the PropertyTagOrientation field in the EXIF meta data (using GDI - Image.PropertyItems ), but the field isn't present. So it's either some specific

教学、会议、展厅大并发无线互联网直播同屏实现之LibEasyScreenLive通过GDI方式实现屏幕捕获采集方法介绍

陌路散爱 提交于 2019-12-16 10:29:00
EasyScreenLive功能介绍 青犀团队根据市场需求研发的EasyScreenLive,就是一款简单、高效、稳定的集采集,编码,组播,推流和流媒体RTSP服务于一身的同屏功能组件,具低延时,高效能,低丢包等特点。目前支持Windows,Android平台,通过EasyScreenLive我们就可以避免接触到稍显复杂的音视频源采集,编码和流媒体推送以及RTSP/RTP/RTCP/RTMP服务流程,只需要调用EasyScreenLive的几个API接口,就能轻松、稳定地把流媒体音视频数据RTMP推送给EasyDSS服务器以及发布RTSPServer服务, RTSP同屏服务支持组播和单播两种模式。 LibEasyScreenLive通过GDI方式实现屏幕捕获采集 windows端最通用的屏幕捕获方式就是通过GDI(图形设备接口)获取桌面的设备上下文DC,然后将其内容转换为RGB位图,从而转换成视频帧实现屏幕的采集,GDI是一种微软较为古老的技术,其采集效率相对较低,不过实现30fps帧率的桌面采集还是绰绰有余的,而且在设备性能较差或者操作系统版本较低的系统上也能兼容。 LibEasyScreenLive通过GDI方式实现屏幕捕获采集的实现主要是通过CCaptureScreen 类实现,该类声明如下: class CCaptureScreen { public:

How do I determine if a DIB is bottom-up or top-down?

吃可爱长大的小学妹 提交于 2019-12-14 03:46:24
问题 If I create a DIB using CreateDIBSection() , I can specify wether it should be top-down or bottom-up by setting the biHeight field of the BITMAPINFOHEADER struct to a negative or positive value. However, if i call GetObject() on such a bitmap to fill a DIBSECTION structure, then both the dsBm.bmHeight and dsBmih.biHeight seem to be always positive. Is there a way to find out if a DIB is top-down or bottom-up when all I have is the HBITMAP ? 回答1: I think the best you're going to be able to get

Dialog box improperly repaints its background

天大地大妈咪最大 提交于 2019-12-14 02:43:08
问题 I have a dialog box that should have a custom image as a background. I do not have the whole image as a bitmap or any other format, so I have to draw it from scratch. I use an icon (the male in the left bottom of the screenshot) , one EMF file (the map on the screen shot below), and the rest consists of a green gradient brush, light gray hatched brush, and text - all being drawn using GDI . The result of my drawing looks like this (the screen shot includes the controls too): The problem I

Raw/Direct acess on pixels data in a BITMAPINFO (HBITMAP)

丶灬走出姿态 提交于 2019-12-13 19:19:01
问题 I'm trying to figure out how do I acess raw pixel information from screen. So far I've been capturing the screen to a HBITMAP, populating a BITMAPINFO then creating a pointer of this BITMAPINFO variable to read directly from the memory. I know that the header must be "removed" from the file, so I advance the pointer directly to the bitmap data (adding sizeof(MyBMInfo2->bmiHeader) to my pointer offset). I also know that this bitmap is inversed/topdown, the first pixels are on the end of the

CreateCompatibleDC(IntPtr.Zero) returns IntPtr.Zero

半世苍凉 提交于 2019-12-13 17:34:02
问题 I have the following code for a class. This is the initialize of a class. Third Party DLL [DllImport("gdi32.dll")] public static extern IntPtr CreateCompatibleDC(IntPtr hdc); protected void initialize() { if (_initialized) { return; } if (_hdc == IntPtr.Zero) { _hdc = GDI32.CreateCompatibleDC(IntPtr.Zero); if (_hdc == IntPtr.Zero) { throw new GDIException("Failed to create compatible device context."); } } if (_hFontOld == IntPtr.Zero) { _hFont = FontSettings.GenerateHFont(_fontSetting, _hdc,