CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2007
    Location
    in your pocket
    Posts
    339

    [RESOLVED] bitblt problem

    Hai all,

    Why bitblt does not work on videos and on some windows that i hope created using alphablend functions ?

    my project bitblt from display dc to memory dc.

    thanks.
    "Don't Bring A Knife To A Gun Fight"

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: bitblt problem

    What do you mean, "It doesn't work..."

    That tells us nothing. Post some code, and error msg(s) and line #'s, etc
    Code:
    ' Use Code Tags also
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jul 2007
    Location
    in your pocket
    Posts
    339

    Re: bitblt problem

    No dg.
    in simple words, why you can capture a screen shot of the WMP video using bitblt?
    "Don't Bring A Knife To A Gun Fight"

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: bitblt problem

    BitBlt Copies Pixel data from Shared Video Memory,(Normally sits between 640k & 1024k) however there is a second level of video memory, that bitBlt does not reach.. this is memory that only the Video processor can work with.

    When using hardware accelerated functions, bitBlt will not be able to capture the results.

    Also Hardware decoded video streams can not be captured by BitBlt..

    Gremmy
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #5
    Join Date
    Jul 2007
    Location
    in your pocket
    Posts
    339

    Re: bitblt problem

    Quote Originally Posted by GremlinSA View Post
    BitBlt Copies Pixel data from Shared Video Memory,(Normally sits between 640k & 1024k) however there is a second level of video memory, that bitBlt does not reach.. this is memory that only the Video processor can work with.

    When using hardware accelerated functions, bitBlt will not be able to capture the results.

    Also Hardware decoded video streams can not be captured by BitBlt..

    Gremmy
    Nice explanation Gremlinsa,
    so how to capture them which bitblt cannot reach?
    say, a frame in the WMP.
    Last edited by NotepadGuru; December 27th, 2008 at 11:24 AM.
    "Don't Bring A Knife To A Gun Fight"

  6. #6
    Join Date
    Jul 2007
    Location
    in your pocket
    Posts
    339

    Re: bitblt problem

    I think reducing the hardware acceleration might work. so how to reduce this using code?
    "Don't Bring A Knife To A Gun Fight"

  7. #7
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: bitblt problem

    You know that would slow down everything, if it was even possible. Can you say BOTTLENECK?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  8. #8
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: bitblt problem

    Quote Originally Posted by NotepadGuru View Post
    Nice explanation Gremlinsa,
    so how to capture them which bitblt cannot reach?
    say, a frame in the WMP.
    Hmmm .. that will require you to write your own Media Player, and use software decoders.. And the problem is, many of the software decoders still use some of the hardware acceleration functions, so you will need to shut down all hardware acceleration functions, and then, like David says, Bottleneck the system...

    unfortunately there's not much you can do about all of this, as Windows itself requires allot of these functions to simply operate.

    The other option is to study the built in Functions on the video card, by using some of the built in commands you may be able to get a data stream from the video card direct, problem is these commands are different for each card (why windows requires a driver) and not all cards have a full two way data streaming system..

    Gremmy
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  9. #9
    Join Date
    Dec 2008
    Posts
    19

    Re: bitblt problem

    There are many commercial video capture cards out there. Capturing video is not trivial like bitblt.

    Depending on what you're trying to accomplish, you could certainly pause a video display at any frame and then capture the region of the displayed frame. If all you need is an occasional frame or two that should work okay. If, however, you're trying to capture a series of frames for re-display, etc. you should look in to obtaining video capture card.

  10. #10
    Join Date
    Jul 2007
    Location
    in your pocket
    Posts
    339

    Re: bitblt problem

    Thank boys (David, gremmy, tom) for the comments.
    i had two problem,
    1. could not capture a video frame
    2. Could not capture Layered Windows ( the Name i forgotten to mentioned in my first post. So i put it as "some windows " and you could not figured it out coz of that )

    I manage to solve the second problem by addining a flag CAPTUREBLT with vbsrccopy and sorted out.

    After seeing your comments, i think, for now, video capture is not that important to my project. But now i got some idea about that from your posts. All i had to solve is the layerd window issue.
    "Don't Bring A Knife To A Gun Fight"

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