Re: screenshot and CPU encumbrance / pfDevice and bmDIB

From: guy (xx_at_xx.com)
Date: 03/29/04

  • Next message: David Reeve: "Re: COM-call and critical sections"
    Date: Mon, 29 Mar 2004 03:34:45 GMT
    
    

    I am working on a similar project.

    My question for you: Can you show us a code snippet of how you are doiing
    the capture now?

    In my limmited experience so far, I have seen two basic methods to get
    started...
    Method 1:
            SDC := CreateDC('DISPLAY', 0, 0, 0);//GetDC (
    Handles );
            ok :=
    BitBlt(MyBitmap.Canvas.Handle,0,0,fBlockWid,fBlockHig,SDC,Bound.Left,Bound.T
    op,SRCCOPY);
          finally
            DeleteDC(SDC);
          end;

    Method 2:
          DeskWinHdl := GetDesktopWindow; //note: others use 0 (zero)
    here and also seems to work.
          SDC := GetDC(DW);
          try
            ok :=
    BitBlt(MyBitmap.Canvas.Handle,0,0,BlockWidth,BlockHeight,SDC,BlockLeft,Block
    Top,SRCCOPY);
          finally
            ReleaseDC(DW,SDC);
          end;

    I have not done a lot of CPU cycle watching with either method, but it seems
    to me that you should be able to use and re-use the same bitmap container,
    who's basic properties would only need to be set once. If that is not what
    you are doing now, consider it!

    Now, maybe someone has a suggestion for MY problem with the same area... on
    WIN XP, neither of the above methods is complete!!!!! It does not capture
    SOME text popups (like text extension popups in explorer, or the file
    property popups in explorer, or the popup caption text from tray icon
    applications.) It also fails to catch "rubber band" lines, file-drag
    images (the ones that usually accompany the mouse).... all of these things
    are apparently not really painted "on" the desktop, and are not captured.

    Note: The Print Screen button DOES capture all of these things, and I am
    trying to accomplish exactly the same thing. I want a COMPLETE image of the
    "display".... but rather than going to the clipboard (like PrntScreen would
    do) I want to store it in my own TBitmap, as shown above.

    This may seem like a small problem, but it is serious. PLEASE HELP?!

    Thanks,
     --jph

    Christian Bode <kubopic@gmx.de> wrote in message
    news:bsnt86$81e$01$1@news.t-online.com...
    > hi,
    >
    >
    >
    > I will hope everybody know what i trying to say.
    >
    > I've written a client/server administration tool und my question belongs
    to
    > the screen capturing. My problem is the CPU encumbrance. I take a
    screenshot
    > in a loop of a timer event.
    >
    > If the bitmap has pfDevice as pixeformat it works fine. But has it
    something
    > like pf32Bit the bitmap first must convert into this and that take some
    time
    > and a lot of CPU encumbrance.
    >
    > I need to use pf32Bit because the following scanline action. It only work
    > IMHO with a device independent bitmap format. I know already that i can
    > create a hook the get all changed window information, but the following
    > problem seems to be the same. A perfect screenshot capture. At the next
    step
    > i looking for the dirty rectangles in the bitmap, compress them an put
    them
    > in a stream. Than i transfer the stream over a existing tcp/ip connection.
    > That works already fine and relative fast, but i like to change capturing
    > method.
    >
    > Can anybody help me, so far he know what i mean. I've unfortunately not
    > found many pages with this kind of topic.
    >
    >
    >
    > Thx a lot Christian
    >
    >


  • Next message: David Reeve: "Re: COM-call and critical sections"
  • Quantcast