• 大小: 11.5MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-12
  • 语言: C/C++
  • 标签: c++  

资源简介

包括了这个人的directshow代码:http://download.csdn.net/detail/bifei1983/1024664, 以及directshow库文件代码等,配置文件都在里面,直接用即可。有问题请私信或邮件至huqiaoping23@qq.com.

资源截图

代码片段和文件信息

//------------------------------------------------------------------------------
// File: DibHelper.cpp
//
// Desc: DirectShow sample code - In-memory push mode source filter
//       Helper routines for manipulating bitmaps.
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------------------------

#include 

#include “dibhelper.h“

HBITMAP CopyScreenToBitmap(LPRECT lpRect BYTE *pData BITMAPINFO *pHeader HCURSOR hCursor)
{
    HDC         hScrDC hMemDC;         // screen DC and memory DC
    HBITMAP     hBitmap hOldBitmap;    // handles to deice-dependent bitmaps
    int         nX nY nX2 nY2;       // coordinates of rectangle to grab
    int         nWidth nHeight;        // DIB width and height
    int         xScrn yScrn;           // screen resolution

    // check for an empty rectangle
    if (IsRectEmpty(lpRect))
      return NULL;

    // create a DC for the screen and create
    // a memory DC compatible to screen DC   
    hScrDC = CreateDC(TEXT(“DISPLAY“) NULL NULL NULL);



    hMemDC = CreateCompatibleDC(hScrDC);

    // get points of rectangle to grab
    nX  = lpRect->left;
    nY  = lpRect->top;
    nX2 = lpRect->right;
    nY2 = lpRect->bottom;

    // get screen resolution
    xScrn = GetDeviceCaps(hScrDC HORZRES);
    yScrn = GetDeviceCaps(hScrDC VERTRES);

    //make sure bitmap rectangle is visible
    if (nX < 0)
        nX = 0;
    if (nY < 0)
        nY = 0;
    if (nX2 > xScrn)
        nX2 = xScrn;
    if (nY2 > yScrn)
        nY2 = yScrn;

    nWidth  = nX2 - nX;
    nHeight = nY2 - nY;

    // create a bitmap compatible with the screen DC
    hBitmap = CreateCompatibleBitmap(hScrDC nWidth nHeight);

    // select new bitmap into memory DC
    hOldBitmap = (HBITMAP) Selectobject(hMemDC hBitmap);

    // bitblt screen DC to memory DC
    BitBlt(hMemDC 0 0 nWidth nHeight hScrDC nX nY SRCCOPY);

// draw mouse
POINT pt;
GetCursorPos(&pt);
DrawIconEx(hMemDC pt.x-10 pt.y-10 hCursor 0 0 0 NULL DI_NORMAL);  

    // select old bitmap back into memory DC and get handle to
    // bitmap of the screen   
    hBitmap = (HBITMAP) Selectobject(hMemDC hOldBitmap);

    // Copy the bitmap data into the provided BYTE buffer
    GetDIBits(hScrDC hBitmap 0 nHeight pData pHeader DIB_RGB_COLORS);

    // clean up
    DeleteDC(hScrDC);
    DeleteDC(hMemDC);

    // return handle to the bitmap
    return hBitmap;
}



 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      31944  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\DibHelper.obj

     文件          0  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\DibHelper.sbr

     文件      59154  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\Dll.obj

     文件          0  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\Dll.sbr

     文件     139564  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\Filter.obj

     文件          0  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\Filter.sbr

     文件     920576  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\vc120.idb

     文件     782336  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\vc120.pdb

     文件       2220  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VCam.Build.CppClean.log

     文件       1343  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VCam.exp

     文件       1492  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VCam.lib

     文件    6122496  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.bsc

     文件       4989  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.log

     文件        606  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\BscMake.command.1.tlog

     文件        990  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\bscmake.read.1.tlog

     文件        566  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\bscmake.write.1.tlog

     文件       2456  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\cl.command.1.tlog

     文件      70110  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\CL.read.1.tlog

     文件       2270  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\CL.write.1.tlog

     文件       1452  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\link.command.1.tlog

     文件       3818  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\link.read.1.tlog

     文件        778  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\link.write.1.tlog

     文件        194  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\VirtualCamera.lastbuildstate

     文件        420  2016-11-14 20:09  VirtualCamera源代码+配置\Debug\VirtualCamera.tlog\VirtualCamera.write.1u.tlog

     文件       2577  2009-02-19 16:18  VirtualCamera源代码+配置\DibHelper.cpp

     文件       1701  2009-02-19 14:43  VirtualCamera源代码+配置\DibHelper.h

     文件        586  2016-11-14 12:04  VirtualCamera源代码+配置\directshow.props

     文件       3655  2016-11-14 20:09  VirtualCamera源代码+配置\Dll.cpp

     文件        257  2009-02-19 11:04  VirtualCamera源代码+配置\Dll.def

     文件       1644  2014-09-16 23:38  VirtualCamera源代码+配置\dshow\include\baseclasses\amextra.h

............此处省略65个文件信息

评论

共有 条评论