How can I capture a semi transparent window?

Hello all
I am trying to grab an image of a semi transparent window into a bitmap. I have tried using both CopyFromScreen and BitBlt using the window handle but in both cases all I get is the image from behind the window I want to catch, it's like the semi transparent
window is completely invisible to both capture methods. Is there any way I can capture the window I want?
Thanks
Rich

Here is an example. You can try it in a new form project with 1 Button and 1 PictureBox added to the form. As i said, it is just an example so, when it is run the form will be partialy transparent. Click the button and it will capture the whole screen including
your transparent form. Then it will set the forms opacity back to 1.0 so you can see that the transparent form was captured in the image.
 You will need to set it up to be used in a practical way. This is just a quick test example.
Imports System.Runtime.InteropServices
Public Class Form1
Private Const CAPTUREBLT As Integer = &H40000000
Private Const SRCCOPY As Integer = &HCC0020
<DllImport("gdi32.dll", EntryPoint:="BitBlt")> _
Private Shared Function BitBlt(ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
<DllImport("user32.dll", EntryPoint:="GetDC")> Private Shared Function GetDC(ByVal hWnd As System.IntPtr) As System.IntPtr
End Function
<DllImport("user32.dll", EntryPoint:="ReleaseDC")> Private Shared Function ReleaseDC(ByVal hWnd As System.IntPtr, ByVal hDC As System.IntPtr) As Integer
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'set this form so it is partialy transparen. Just to show it was captured for this example
Me.Opacity = 0.5
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'if the picturebox has an Image the Dispose it first
If PictureBox1.Image IsNot Nothing Then PictureBox1.Image.Dispose()
'define the rectangle area of the screen to capture (whole screen in this case)
Dim CaptureRectangle As Rectangle = Screen.PrimaryScreen.Bounds
'Assign the new image captured from the screen to the picturebox image
PictureBox1.Image = CaptureScreenImage(CaptureRectangle)
'just so you can see the image better set the form`s opacity back to 1.0
Me.Opacity = 1.0
End Sub
Private Function CaptureScreenImage(ByVal rect As Rectangle) As Bitmap
Dim scrnHdc As IntPtr = GetDC(IntPtr.Zero)
Dim bmp As New Bitmap(rect.Width, rect.Height)
Using grx As Graphics = Graphics.FromImage(bmp)
Dim grxHdc As IntPtr = grx.GetHdc()
BitBlt(grxHdc, 0, 0, rect.Width, rect.Height, scrnHdc, rect.X, rect.Y, SRCCOPY Or CAPTUREBLT)
grx.ReleaseHdc(grxHdc)
ReleaseDC(IntPtr.Zero, scrnHdc)
End Using
Return bmp
End Function
End Class
If you say it can`t be done then i`ll try it

Similar Messages

  • How can I capture Microsoft EventSource Events on a Windows Phone?

    I use
    Microsoft EventSource Library to create events to instrument our applications. For Windows Applications running on Windows 7/8/8.1 I can use xperf
    to capture the events (xperf.exe" -start UserLogger -on GUID -f User.etl).
    But how can I do this on a Windows Phone 8.1?
    I use Win8.1 Pro (x64), VS2013 Community Edition with Update4 and try capture a trace with the custom events on my Lumia 1320 Dev Preview Update Build 8.10.14203.

    Hi Andre,
    First, sorry about the inconvenience Franklin brought to you.
    Developer Power tools can be used to capture ETW log, but I think it will not work for custom events. Check the
    thread replied by Eric.
    AFAIK, the option to capture custom events only opens to Microsoft OEMs as mentioned in
    this article.
    And I just found the following uservoice in our
    official uservoice channel.
    https://wpdev.uservoice.com/forums/110705-dev-platform/suggestions/6101326-enable-collection-of-custom-etw-events-to-etl-fil
    I think you can vote on that thread to push that.
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    Alan Yao
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • In v.11, how can I capture video but not audio from a camera?

    In v.11, how can I capture video but not audio from a camera?

    Rodney
    I see what you mean....Premiere Elements 10 appears to be the last version that had options for the user to select Capture Video and/or Audio in the its Capture Window.
    If you are doing DV data capture firewire into the Premiere Elements 11 Capture Windows and want a final file without audio and you cannot do this at the camera level, then consider....
    1. Do the Capture "to the Timeline" - video linked to audio result on the project's Video Track 1
    a. Right click the Timeline DV AVl and select Delete Audio and then edit accordingly.
    or
    b. Import the DV AVI but, when you go to export it, in the export settings, remove the check mark next to Audio so that the export contains only the video portion.
    Publish+Share/Computer/AVI with Presets = DV NTSC Standard
    Please let us know if any of that worked for you.
    Thank you.
    ATR

  • How can I develop co-broswing on Windows platform with java language?

    How can I develop co-broswing on Windows platform with java language?
    The function will be realized
    Now I want to develop a co-broswing system with java language on Windows platform.That is to say I will develop
    a application run on client to track the present browser.Wheh the URL address of your present if changed(for example
    when you click a link or submit a form),the application will capture the new URL address and send it to the other
    client that make co-browsing connect with you.The browser on the other client side will catch the new URL and refesh
    the page to show the page.
    The question I fall across and want to ask you
    (1)How to watch system process with java on the Windows platform?Because I want to get the process information of
    the present broswer,and then get the URL address of the present broswer.
    (2)Develop an application to watch the URL address of the present broswer continuance,If the URL address is changed,
    then send the new URL address to the client on the other side,let his broswer to show the new page using the new URL.

    Paulc, A proxy server is not the right thing.
    What our man here is looking for is a solution for two
    users to kind of surf the net "in tandem" - when one
    user navigates to a different web page, so does the
    other user,
    These are typically used in call center applications
    where the advisor guides a caller through , say
    filling in an insurance form or pointing him to the
    right product specification pages.
    Xing, why are you using Java for this ? You need
    something that has better windows integration. If you
    look on MSDN.microsoft.com and search for "explorer
    bar" you will find solutions to the questions that you
    raised.
    There are also commercial products on the market that
    already do this kind of stuff. there is one from
    www.genesyslabs.com which is considered to be the best
    of breed.
    It is difficult or almost impossible to do this in
    Java for a commercial application.
    If you are developing this as an academic exercise,
    give it a try. Post your email address here, and I
    will contact and help you out if you like.my e-mail is below ,I want to contact you and need all of your help.
    [email protected]

  • HT1296 How can I capture and save an image on my screen for later retrieval

    How can I capture and save an image on my iPad screen for later retrieval, perhaps on my Laptop (Windows 7)?
    Is there a way to copy the image to a storage device?
    Thanks, Don.

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Its easy to take an iPad screenshot. Press & release the Home and the Power buttons quickly at the same time. I have trouble with that so I press & hold the Home button and then very quickly press and release the Power button. Your screenshot is stored in the Camera Roll of the Photos app. Probably the easiest way to get it to your PC is to be using iCloud, or email it to your PC. There are also some wireless sync apps in the iTunes app store that let you send photos from the iPad to a Mac or PC. I use PhotoSync.

  • How can i transfer movies from my windows laptop to ipad 3

    how can i transfer movies from my windows laptop to ipad 3

    Import them into iTunes then sync them to your iPad

  • How can I capture an externally hosted page as a variable ?

    How can I capture the html or css of an externally hosted
    page and use it as a local variable ? There's plenty of options for
    doing it with local file but I can't work out how to go about it
    when the file isn't on your cf server. Any ideas ?

    Yes, of course.
    {insert the sound of slapping oneself in the head here}

  • HT1338 How can i use my data on windows or mac when i use one of them in the same time?

    Hi,
    i have a Mac book with 2 operating system, ( Windows& mac). How can i use my data on windows or mac when i use one of them in the same time?
    Thank you

    The following article(s) may help you.
    Resolving duplicate calendars
    Resolving duplicate contacts

  • How can I download itunes from my windows vista to my ipod original?

    How can I download itunes from my windows vista to my ipod classic?

    If you want to add songs from iTunes to the iPod, plug it into the computer, select the iPod in iTunes and click the tabs across top to select what you want on the iPod.

  • How can i install flash player for window 8.1(64 bit) on my laptop

    how can i install flash player for window 8.1(64 bit) on my laptop?

    For Internet Explorer, you don't. Microsoft has already done it.
    For Firefox, Opera or Safari, use the Flash Player Plug-in (All other browsers)
    For Chrome, you don't need to wither because Google puts it in the browser.

  • In ALV reports how can we capture separate data in 3 internal table

    HI
       In ALV reports how can we capture data in 3 Internal tables and combine them in another internal table to display........

    Hello Sudhanshu
    Another option would be to display all three itabs together which is a piece of cake using OO-based ALV lists. Please refer to thread
    Re: Alv
    for a sample report.
    Regards
      Uwe

  • How can I capture in forms the text from a database error

    In forms6i, how can I capture the text of an error during the execution of a dabatase procedure or package.
    Thanks for your help.

    You can use SQLERRM function :
    SQL> create or replace procedure procerr
      2  is
      3     n number;
      4  begin
      5     n := 1/0;
      6* end;
    SQL> /
    Procedure created.
    SQL> set serveroutput on
    SQL> declare
      2     err1    varchar2(200);
      3  begin
      4     procerr;
      5  exception
      6     when others then
      7             err1 := SQLERRM;
      8             dbms_output.put_line(err1);
      9* end;
    SQL> /
    ORA-01476: divisor is equal to zero
    PL/SQL procedure successfully completed.
    SQL>

  • How can  I capture a specific number of screen caps

    Using final cut or any other application, how can I capture a specific number of screen caps? Each video will have a different length.

    Bob,
    Please clarify your question. Are you asking about screen captures? If so, what software are you using and what does this have to do with FCP?
    -DH

  • How can I install and run a Windows program on my MacBook Pro/?

    How can I install and run a Windows program on my MacBook Pro?

    You have several options.
    1, Use a Virtual Machine like Vmware, Parallels etc... to Create a Virtual Windows Installation and Run your program in there.  A Virtual MAchine will runn in a Window on your Desktop and share your Mac's resources RAM HD space processor. Your MAc desktop will still be available while you run Windows install.
    http://www.parallels.com/
    2. Install Windows on a partition using Bootcamp. It will run a full installation of Windows you can boot into, and run your programs.  The Mac desktop will not available until your reboot the computer and start in OSx instead of Windows.
    https://www.apple.com/support/bootcamp/
    3. Use Wine /  Winebottler to run the Application without the need for a complete Windows installation.
    http://winebottler.kronenberg.org/

  • My 1st ipod was lost. My library is on a Dell with Windows.  I registered my new ipod to a Mac.  How can I get my library from Windows onto my new Ipod?

    My 1st ipod was lost. My library is on a Dell with Windows.  I registered my new ipod to a Mac.  How can I get my library from Windows onto my new Ipod?

    Thank you for your help.  I am still having trouble.  As you can tell, I am not technologically advanced AT ALL.  My music is all showing up in the library but when I go to file in the top left corner, Sync is greyed out and I cannot select it.  I'm gonna continue to try this.  It's been a long time since I had my 1st ipod and things have changed so much I will probably need to research this stuff.  Thanks again for your help.

Maybe you are looking for

  • How to use two ALV grids in a single program (pl read below for details)?

    Please read thoroughly:: I have an ALV report using REUSE_ALV_GRID_DISPLAY. On the output of this report, when I click on a "change" button, a couple of columns should be made editable. I achieved this by modifying the fieldcatalog and triggering the

  • CX11NF no longer shows up

    I have read all the posts regarding Epson and snow leopard and I am at a loss and pulling my hair out, cursing apple and jobs, and throwing darts at the snow leopard logo now on my dart board. I am soooooooooooooooo frustrated that I even paid for th

  • Condition types related to planned delivery costs (Freight) from a PO.

    Hi Friends, I want to know which condition type is related to Freight in a purchase order. I have a PO which has different conditions like PBXX, FRB1, FRC1, etc. under the conditions tab. I want to get only freight related conditions through a bapi.

  • Windows Printer Profiles

    Please can someone tell me if it's possible to save print profiles on printer drivers shared by SMB? I have followed several posts/internet how-tos on setting up automatic download of printer drivers to Windows machines from our Xserve and it appears

  • Sales order released from Credit block, but Purchase Requistion not created

    Hi, In third party sales scenario based on Scheduline Line category configuration purchase requistion creates when the order is created. If order is blocked for credit check then purchase requistion will not be created until order released from credi