CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2022
    Posts
    2

    How to capture the screen of a window that contains transparency?

    Trying to find a way to capture a window that contains transparency that also works when the window is covered by another.

    I tried the function [PrintWindow] but it doesn't store the transparency information in the hdc.
    If possible using gdi+.


    https://docs.microsoft.com/en-us/win...er-printwindow

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,218

    Re: How to capture the screen of a window that contains transparency?

    Victor Nijegorodov

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,609

    Re: How to capture the screen of a window that contains transparency?

    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.2.0)

  4. #4
    Join Date
    Jan 2022
    Posts
    2

    Re: How to capture the screen of a window that contains transparency?

    2kaud, tell me how linking to a topic that got no useful answer could help in something?
    I posted on different websites because I was not finding any helpful answers.

    Quote Originally Posted by VictorN View Post
    I already had tried BitBlc with the rasters SRCCOPY and CAPTUREBLT
    Then I did GdipCreateFromHDC to retrieve the graphics from the dc, and GdipDrawImageRectRect to paint the bitmap, but it result in a bitmap without any transparency.
    Last edited by c7aesa7r; January 20th, 2022 at 10:08 AM.

  5. #5
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,609

    Re: How to capture the screen of a window that contains transparency?

    @c7aesa7r - It is good etiquette to indicate where else it has been posted. This enables any potential reply-er to find out what has already been suggested before spending time replying or looking into the issue. People who reply do it in their own time without payment - just to try to help others.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.2.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured