gdi

How can I omit capturing of a button/region using DirectShow APIs?

删除回忆录丶 提交于 2019-12-12 02:23:00
问题 I am using "Push Source Desktop" filter for capturing screen in my application. I hide my application while recording is going on. Only a button for stopping the recording is visible on screen. The button also gets recorded by the filter. During playback of the saved recording the button is visible along with rest of the screen region. Is there any way I can prevent the button from getting recorded ? My aim is to record the screen without the button. I cannot hide the button as it required

Change GDI pen colour

倖福魔咒の 提交于 2019-12-12 01:37:42
问题 Is it possible to change the custom pen colour attribute after creating it using this call? HPEN hPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); //Create a solid pen. or how should i create a pen whose colour colour can be changed. 回答1: I am afraid that this is not possible using any non-esoteric approach. I think, however, that you can use the DC_PEN stock object and the SetDCPenColor function, like so: SelectObject(dc, GetStockObject(DC_PEN)); SetDCPenColor(dc, clGreen); Rectangle(dc, 10, 10,

How to GetGuiResources for all system processes?

家住魔仙堡 提交于 2019-12-12 01:35:12
问题 I need to measure all used GDI objects in a Windows xp system. I found a GetGuiResources(__in HANDLE hProcess, __in DWORD uiFlags) method (with the GR_GDIOBJECTS flag). I call it for the process which I get from the method GetCurrentProcess() defined in WinBase.h. I don't know how to call it for other system processes, which I get by System::Diagnostics::Process::GetProcesses(), because that function returns an array of Process pointers, and GetGuiResources takes a HANDLE. Does anybody know a

How to scroll window contents using Direct2D api?

 ̄綄美尐妖づ 提交于 2019-12-12 00:36:38
问题 I would like to scroll window contents in which drawing is performed with Direct2D api through ID2D1RenderTarget. In GDI I could create a buffer with CreateCompatibleDC and later scroll its contents with ScrollDC, redraw exposed area and BitBlt the buffer to window. I cannot see any necessary API in Direct2D to perform the same operations. How can I achieve the same functionality without using GetDC (and GDI), and without using own third buffer? 回答1: There is no Scroll API in Direct2D. Your

How to let gdi/gid+ object (pen\brush\rect\region etc.) semi-transparent?

纵然是瞬间 提交于 2019-12-11 21:48:42
问题 I want draw multi layer in DC. each layer have some gdi/gdi+ object and semi-transparent with the underlayer. 回答1: you need to use the ARGB system for coloring. A represents transparency, it takes a value between 0 and 255. a value of 125 is semi transparant 回答2: Using the function SetROP2 with the argument R2_MASKPEN is a very simple way to get a transparent pen effect. 来源: https://stackoverflow.com/questions/4261536/how-to-let-gdi-gid-object-pen-brush-rect-region-etc-semi-transparent

Changing win32's radio button text color

依然范特西╮ 提交于 2019-12-11 19:38:26
问题 Upon color change, i listen to WM_CTLCOLORSTATIC and act accordingly: LRESULT ProcessWindowMessage(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam) { switch (uMsg) { case WM_CTLCOLORSTATIC: LRESULT lBrush = ::DefWindowProc(hWnd, uMsg, wParam, lParam); // get default brush used so far ::SetBkMode((HDC)wParam, TRANSPARENT); ::SetTextColor((HDC)wParam, RGB(m_color.red, m_color.green, m_color.blue)); return lBrush; } } This works well with regular static-texts: labels and

Searching a rectangle on the screen for and comparing to an image? Imagesearching

末鹿安然 提交于 2019-12-11 18:31:59
问题 I am wondering how I could search a set rectangle on the screen and have it compare to an image that I specify to see if it matches? Lets say it could Search x1 y1 to x2 y2 and compare against an image? and return the boolean? I know Auto-it has a similar function seen here: http://www.autohotkey.com/docs/commands/ImageSearch.htm Has anyone done this that they could reference? I am using vb.net. EDIT: Abdias, I have put your code into a class instead and I am calling it like this: Dim bm As

How can I draw a patternBrush with transparent backround (GDI)?

跟風遠走 提交于 2019-12-11 17:45:00
问题 I can't draw a pattern with a transparent background. This is my snippet : bitmap.CreateBitmap(8, 8, 1, 1, &bits) brush.CreatePatternBrush(&bitmap) hbrush = pCgrCurrentDC->SelectObject(&brush); // set text color TextCol = pCgrCurrentDC->SetTextColor(CgrColourPalRGB); int oldBkgrdMode = pCgrCurrentDC->SetBkMode(TRANSPARENT); //draw polygon pCgrCurrentDC->Polygon(CgrBuffer, n); The doc on msdn doesn't mention anything about transparency. I guess this mode could be used? Or is this a bug ?

is screenshotting by DirectDraw faster than GDI way?

让人想犯罪 __ 提交于 2019-12-11 15:48:26
问题 just to save some time, probably anybody tried this or saw somewhere related info. asking about DirectDraw and not about DirectX because I need to support Win2000 and up, and I cannot install DirectX on target PC 回答1: tried capturing by Direct3D and compared with GDI way. Results are not unambiguous. On my Win7 x64 with rather good video card D3D way shows ~2 times performance boost. On my WinXP 32bits laptop with not-integrated but old video card D3D works much much much longer. On another

hwnd thread affinity painting from a different thread

▼魔方 西西 提交于 2019-12-11 15:05:26
问题 I've a DGRect::draw(HWND hwnd) which simply draws a Blank HBITMAP on hwnd window Handle. I works fine If I call it from main() . It even works correctly If called from DGRDPServer::DGRDPServer() constructor which is QTcpServer Derived. It also works well from DGRDPServer::listen(qint64 port) . The hwnd is passed in DGRDPServer constructor. The Problem appears when I call it from DGRDPServer::incomingConnection(int socketDescriptor) I've qDebug() ed value of hwnd and its Okay. Whats Causing