<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?!]]></title><description><![CDATA[<pre><code class="language-cpp">//---------------------------------------------------------------------------
#include &lt;vcl.h&gt;

#pragma hdrstop

#include &quot;Unit1.h&quot;
#include &quot;WDMCap.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//
// Global data
//
PCWDMCapture pcap=NULL;
PCSampleCallbackSink pbsink=NULL;

CALLBACKINFO cb={0};
long lWidth;
long lHeight ;

Graphics::TBitmap *Bitmap3 = new Graphics::TBitmap;
//Bitmap3-&gt;Bpp = 24;
//B/itmap3-&gt;Width = 500;
//Bitmap3-&gt;Height = 500;

//---------------------------------------------------------------------------
   // This function will be called whenever a captured still needs to be
    // displayed in the preview window.  It is called initially within
    // CopyBitmap() to display the captured still, but it is also called
    // whenever the main dialog needs to repaint and when we transition
    // from video capture mode back into still capture mode.
    //
    BOOL DisplayCapturedBits(HWND hwndStill,BYTE *pBuffer, BITMAPINFOHEADER *pbih)
    {
        // put bits into the preview window with StretchDIBits
        //
         RECT rc;
        ::GetWindowRect( hwndStill, &amp;rc );
        long lStillWidth = rc.right - rc.left;
        long lStillHeight = rc.bottom - rc.top;

        HDC hdcStill = GetDC( hwndStill );
        PAINTSTRUCT ps;
        BeginPaint(hwndStill, &amp;ps);

        SetStretchBltMode(hdcStill, COLORONCOLOR);
        StretchDIBits( 
            hdcStill, 0, 0, 
            lStillWidth, lStillHeight, 
            0, 0, lWidth, lHeight, 
            pBuffer, 
            (BITMAPINFO*) pbih, 
            DIB_RGB_COLORS, 
            SRCCOPY );

        EndPaint(hwndStill, &amp;ps);
        ReleaseDC( hwndStill, hdcStill );    

        return TRUE;
    }
//---------------------------------------------------------------------------
   // This is the implementation function that writes the captured video
    // data onto a bitmap on the user's disk.
    //
   BOOL CopyBitmap(HWND hwndStill,double dblSampleTime, BYTE * pBuffer, long lBufferSize)
    {

         // figure out where to capture to
        //
    long m_nCapTimes=1;
    TCHAR m_szCapDir[MAX_PATH]=&quot;C:\\&quot;; // the directory we want to capture to
    TCHAR m_szSnappedName[MAX_PATH];
    BOOL bFileWritten;
        TCHAR m_ShortName[MAX_PATH];
        wsprintf( m_szSnappedName, TEXT(&quot;%sStillCap%4.4ld.bmp&quot;),
                  m_szCapDir, m_nCapTimes );
        wsprintf( m_ShortName, TEXT(&quot;StillCap%4.4ld.bmp&quot;),
                  m_nCapTimes);

        // write out a BMP file
        //
        HANDLE hf = CreateFile(
            m_szSnappedName, GENERIC_WRITE, 0, NULL,
            CREATE_ALWAYS, NULL, NULL );

        if( hf == INVALID_HANDLE_VALUE )
            return 0;

        // write out the file header
        //
        BITMAPFILEHEADER bfh;
        memset( &amp;bfh, 0, sizeof( bfh ) );
        bfh.bfType = 'MB';
        bfh.bfSize    = sizeof( bfh ) + lBufferSize + sizeof( BITMAPINFOHEADER );
        bfh.bfOffBits = sizeof( BITMAPINFOHEADER )  + sizeof( BITMAPFILEHEADER );

        DWORD dwWritten = 0;
        WriteFile( hf, &amp;bfh, sizeof( bfh ), &amp;dwWritten, NULL );

        // and the bitmap format
        //
        BITMAPINFOHEADER bih;
        memset( &amp;bih, 0, sizeof( bih ) );
        bih.biSize = sizeof( bih );
        bih.biWidth = lWidth;
        bih.biHeight = lHeight;
        bih.biPlanes = 1;
        bih.biBitCount = 24;

        dwWritten = 0;
        WriteFile( hf, &amp;bih, sizeof( bih ), &amp;dwWritten, NULL );

        // and the bits themselves
        //
        dwWritten = 0;
        WriteFile( hf, pBuffer, lBufferSize, &amp;dwWritten, NULL );
        CloseHandle( hf );
        bFileWritten = TRUE;

        // Display the bitmap bits on the dialog's preview window
        DisplayCapturedBits(hwndStill,pBuffer, &amp;bih);

        // Save bitmap header for later use when repainting the window
        memcpy(&amp;(cb.bih), &amp;bih, sizeof(bih));        

        return 0;
    }
//---------------------------------------------------------------------------
void FASTCALL DoRenderStream(double dblSampleTime, BYTE * pBuffer, long lBufferSize,long _lWidth,long _lHeight)
{
   lWidth=_lWidth;
   lHeight=_lHeight;

        // Since we can't access Windows API functions in this callback, just
        // copy the bitmap data to a global structure for later reference.
        cb.dblSampleTime = dblSampleTime;
        cb.lBufferSize   = lBufferSize;

        // If we haven't yet allocated the data buffer, do it now.
        // Just allocate what we need to store the new bitmap.
        if (!cb.pBuffer)
            cb.pBuffer = new BYTE[lBufferSize];

        // Copy the bitmap data into our global buffer
        if (cb.pBuffer)
            memcpy(cb.pBuffer, pBuffer, lBufferSize);

        // Post a message to our application, telling it to come back
        // and write the saved data to a bitmap file on the user's disk.
        PostMessage(Form1-&gt;Handle, WM_CAPTURE_BITMAP, 0, 0L);
}
//---------------------------------------------------------------------------
void FASTCALL _OnBufferingDataSink(void* pev)
{
  int ev=(int)&amp;pev;
  MessageBox(0,&quot;&quot;,IntToStr(ev).c_str(),0);
  if(1==ev)
      Form1-&gt;Caption=&quot;WDMUtils test program :Buffering data...&quot;;
  else
       Form1-&gt;Caption=&quot;WDMUtils test program&quot;;
   Form1-&gt;Repaint();
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
   pcap=CWDMCapture::GetWDMCapClassInstance(Handle,WDM_CAPTURE_STREAM);
     if(NULL!=pcap)
    {
        HRESULT hr;
        pcap-&gt;OnDataBuffering =_OnBufferingDataSink;

        pbsink=new CSampleCallbackSink();
        pbsink-&gt;pCallbackSink=DoRenderStream;

        // Create DirectShow graph and start capturing video
        hr = pcap-&gt;StartVideo(pbsink,Panel1-&gt;Handle);
        if (FAILED (hr))
        {
            pcap-&gt;CloseInterfaces();
            DestroyWindow(pcap-&gt;Handle());
        }
        else
        {
            // Don't display the main window until the DirectShow
            // preview graph has been created.  Once video data is
            // being received and processed, the window will appear
            // and immediately have useful video data to dispay.
            // Otherwise, it will be black until video data arrives.
              ShowWindow(pcap-&gt;Handle(), TRUE);
       }
    }

}
//---------------------------------------------------------------------------
void __fastcall TForm1::WndProc( Messages::TMessage &amp;Message )
{
  switch( Message.Msg )
  {
       case WM_GRAPHNOTIFY:
             if(NULL!=pcap)
                {
                 pcap-&gt;HandleGraphEvent((WPARAM)Message.WParam,(LPARAM)Message.LParam);
                }
            break;

        case WM_SIZE:
            if(NULL!=pcap)
            {
                pcap-&gt;ResizeVideoWindow();
            }
            break;

        case WM_WINDOWPOSCHANGED:
            if(NULL!=pcap)
              {
                pcap-&gt;ChangePreviewState(!(IsIconic(Handle)));
              }
            break;

        case WM_CLOSE:            
            // Hide the main window while the graph is destroyed
            if(NULL!=pcap)
            {
                ShowWindow(pcap-&gt;Handle(), SW_HIDE);
                pcap-&gt;CloseInterfaces();  // Stop capturing and release interfaces
            }
            break;

        case WM_DESTROY:
            PostQuitMessage(0);

        // Field the message posted by our SampleGrabber callback function.
        case WM_CAPTURE_BITMAP:
            ///    CopyBitmap(Panel2-&gt;Handle,cb.dblSampleTime, cb.pBuffer, cb.lBufferSize);
               CopyBitmap(Form1-&gt;Handle,cb.dblSampleTime, cb.pBuffer, cb.lBufferSize);
            //  Image1-&gt;Picture-&gt;Bitmap =  cb.pBuffer;
            // Image1-&gt;Picture-&gt;DefaultHandler(Panel2-&gt;DefaultHandler());

          //  PaintBox1-&gt;Canvas-&gt;Pixels[ 1 ][ 1 ] = Panel2-&gt;;
                 break;
  } // switch

  TForm::WndProc( Message );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
  delete pbsink;
  delete pcap;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
  if(!IsIconic(Handle))
        // Update the bitmap preview window, if we have
        // already captured bitmap data
        DisplayCapturedBits(Panel2-&gt;Handle,cb.pBuffer, &amp;(cb.bih));

      //  DisplayCapturedBits(Image1,cb.pBuffer, &amp;(cb.bih));

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
    // Free the memory allocated for our bitmap data buffer
    if (cb.pBuffer != 0)
    {
        delete cb.pBuffer;
        cb.pBuffer = 0;
    }
}
//---------------------------------------------------------------------------
</code></pre>
<p>das teil kopiert den live webcam stream in ein panel, wie bekomme ich jetzt<br />
die roh daten in ein image ? so das ich mit den pixeln weiter arbeiten kann<br />
bin ihrgend wie zu dumm das umzuschreiben kann zwar den stream von dem ding in welchem format auch immer zb aufs form oder auf ein memo feld laden etc..<br />
bekomme aber trozdem net die einzelnen pixel daten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>hilfe !</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149638/webcamstream-gt-panel-funzt-und-wie-bekomme-ich-das-in-ein-image</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 04:38:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149638.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Jun 2006 00:53:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Thu, 08 Jun 2006 00:53:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//---------------------------------------------------------------------------
#include &lt;vcl.h&gt;

#pragma hdrstop

#include &quot;Unit1.h&quot;
#include &quot;WDMCap.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
//
// Global data
//
PCWDMCapture pcap=NULL;
PCSampleCallbackSink pbsink=NULL;

CALLBACKINFO cb={0};
long lWidth;
long lHeight ;

Graphics::TBitmap *Bitmap3 = new Graphics::TBitmap;
//Bitmap3-&gt;Bpp = 24;
//B/itmap3-&gt;Width = 500;
//Bitmap3-&gt;Height = 500;

//---------------------------------------------------------------------------
   // This function will be called whenever a captured still needs to be
    // displayed in the preview window.  It is called initially within
    // CopyBitmap() to display the captured still, but it is also called
    // whenever the main dialog needs to repaint and when we transition
    // from video capture mode back into still capture mode.
    //
    BOOL DisplayCapturedBits(HWND hwndStill,BYTE *pBuffer, BITMAPINFOHEADER *pbih)
    {
        // put bits into the preview window with StretchDIBits
        //
         RECT rc;
        ::GetWindowRect( hwndStill, &amp;rc );
        long lStillWidth = rc.right - rc.left;
        long lStillHeight = rc.bottom - rc.top;

        HDC hdcStill = GetDC( hwndStill );
        PAINTSTRUCT ps;
        BeginPaint(hwndStill, &amp;ps);

        SetStretchBltMode(hdcStill, COLORONCOLOR);
        StretchDIBits( 
            hdcStill, 0, 0, 
            lStillWidth, lStillHeight, 
            0, 0, lWidth, lHeight, 
            pBuffer, 
            (BITMAPINFO*) pbih, 
            DIB_RGB_COLORS, 
            SRCCOPY );

        EndPaint(hwndStill, &amp;ps);
        ReleaseDC( hwndStill, hdcStill );    

        return TRUE;
    }
//---------------------------------------------------------------------------
   // This is the implementation function that writes the captured video
    // data onto a bitmap on the user's disk.
    //
   BOOL CopyBitmap(HWND hwndStill,double dblSampleTime, BYTE * pBuffer, long lBufferSize)
    {

         // figure out where to capture to
        //
    long m_nCapTimes=1;
    TCHAR m_szCapDir[MAX_PATH]=&quot;C:\\&quot;; // the directory we want to capture to
    TCHAR m_szSnappedName[MAX_PATH];
    BOOL bFileWritten;
        TCHAR m_ShortName[MAX_PATH];
        wsprintf( m_szSnappedName, TEXT(&quot;%sStillCap%4.4ld.bmp&quot;),
                  m_szCapDir, m_nCapTimes );
        wsprintf( m_ShortName, TEXT(&quot;StillCap%4.4ld.bmp&quot;),
                  m_nCapTimes);

        // write out a BMP file
        //
        HANDLE hf = CreateFile(
            m_szSnappedName, GENERIC_WRITE, 0, NULL,
            CREATE_ALWAYS, NULL, NULL );

        if( hf == INVALID_HANDLE_VALUE )
            return 0;

        // write out the file header
        //
        BITMAPFILEHEADER bfh;
        memset( &amp;bfh, 0, sizeof( bfh ) );
        bfh.bfType = 'MB';
        bfh.bfSize    = sizeof( bfh ) + lBufferSize + sizeof( BITMAPINFOHEADER );
        bfh.bfOffBits = sizeof( BITMAPINFOHEADER )  + sizeof( BITMAPFILEHEADER );

        DWORD dwWritten = 0;
        WriteFile( hf, &amp;bfh, sizeof( bfh ), &amp;dwWritten, NULL );

        // and the bitmap format
        //
        BITMAPINFOHEADER bih;
        memset( &amp;bih, 0, sizeof( bih ) );
        bih.biSize = sizeof( bih );
        bih.biWidth = lWidth;
        bih.biHeight = lHeight;
        bih.biPlanes = 1;
        bih.biBitCount = 24;

        dwWritten = 0;
        WriteFile( hf, &amp;bih, sizeof( bih ), &amp;dwWritten, NULL );

        // and the bits themselves
        //
        dwWritten = 0;
        WriteFile( hf, pBuffer, lBufferSize, &amp;dwWritten, NULL );
        CloseHandle( hf );
        bFileWritten = TRUE;

        // Display the bitmap bits on the dialog's preview window
        DisplayCapturedBits(hwndStill,pBuffer, &amp;bih);

        // Save bitmap header for later use when repainting the window
        memcpy(&amp;(cb.bih), &amp;bih, sizeof(bih));        

        return 0;
    }
//---------------------------------------------------------------------------
void FASTCALL DoRenderStream(double dblSampleTime, BYTE * pBuffer, long lBufferSize,long _lWidth,long _lHeight)
{
   lWidth=_lWidth;
   lHeight=_lHeight;

        // Since we can't access Windows API functions in this callback, just
        // copy the bitmap data to a global structure for later reference.
        cb.dblSampleTime = dblSampleTime;
        cb.lBufferSize   = lBufferSize;

        // If we haven't yet allocated the data buffer, do it now.
        // Just allocate what we need to store the new bitmap.
        if (!cb.pBuffer)
            cb.pBuffer = new BYTE[lBufferSize];

        // Copy the bitmap data into our global buffer
        if (cb.pBuffer)
            memcpy(cb.pBuffer, pBuffer, lBufferSize);

        // Post a message to our application, telling it to come back
        // and write the saved data to a bitmap file on the user's disk.
        PostMessage(Form1-&gt;Handle, WM_CAPTURE_BITMAP, 0, 0L);
}
//---------------------------------------------------------------------------
void FASTCALL _OnBufferingDataSink(void* pev)
{
  int ev=(int)&amp;pev;
  MessageBox(0,&quot;&quot;,IntToStr(ev).c_str(),0);
  if(1==ev)
      Form1-&gt;Caption=&quot;WDMUtils test program :Buffering data...&quot;;
  else
       Form1-&gt;Caption=&quot;WDMUtils test program&quot;;
   Form1-&gt;Repaint();
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
   pcap=CWDMCapture::GetWDMCapClassInstance(Handle,WDM_CAPTURE_STREAM);
     if(NULL!=pcap)
    {
        HRESULT hr;
        pcap-&gt;OnDataBuffering =_OnBufferingDataSink;

        pbsink=new CSampleCallbackSink();
        pbsink-&gt;pCallbackSink=DoRenderStream;

        // Create DirectShow graph and start capturing video
        hr = pcap-&gt;StartVideo(pbsink,Panel1-&gt;Handle);
        if (FAILED (hr))
        {
            pcap-&gt;CloseInterfaces();
            DestroyWindow(pcap-&gt;Handle());
        }
        else
        {
            // Don't display the main window until the DirectShow
            // preview graph has been created.  Once video data is
            // being received and processed, the window will appear
            // and immediately have useful video data to dispay.
            // Otherwise, it will be black until video data arrives.
              ShowWindow(pcap-&gt;Handle(), TRUE);
       }
    }

}
//---------------------------------------------------------------------------
void __fastcall TForm1::WndProc( Messages::TMessage &amp;Message )
{
  switch( Message.Msg )
  {
       case WM_GRAPHNOTIFY:
             if(NULL!=pcap)
                {
                 pcap-&gt;HandleGraphEvent((WPARAM)Message.WParam,(LPARAM)Message.LParam);
                }
            break;

        case WM_SIZE:
            if(NULL!=pcap)
            {
                pcap-&gt;ResizeVideoWindow();
            }
            break;

        case WM_WINDOWPOSCHANGED:
            if(NULL!=pcap)
              {
                pcap-&gt;ChangePreviewState(!(IsIconic(Handle)));
              }
            break;

        case WM_CLOSE:            
            // Hide the main window while the graph is destroyed
            if(NULL!=pcap)
            {
                ShowWindow(pcap-&gt;Handle(), SW_HIDE);
                pcap-&gt;CloseInterfaces();  // Stop capturing and release interfaces
            }
            break;

        case WM_DESTROY:
            PostQuitMessage(0);

        // Field the message posted by our SampleGrabber callback function.
        case WM_CAPTURE_BITMAP:
            ///    CopyBitmap(Panel2-&gt;Handle,cb.dblSampleTime, cb.pBuffer, cb.lBufferSize);
               CopyBitmap(Form1-&gt;Handle,cb.dblSampleTime, cb.pBuffer, cb.lBufferSize);
            //  Image1-&gt;Picture-&gt;Bitmap =  cb.pBuffer;
            // Image1-&gt;Picture-&gt;DefaultHandler(Panel2-&gt;DefaultHandler());

          //  PaintBox1-&gt;Canvas-&gt;Pixels[ 1 ][ 1 ] = Panel2-&gt;;
                 break;
  } // switch

  TForm::WndProc( Message );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
  delete pbsink;
  delete pcap;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
  if(!IsIconic(Handle))
        // Update the bitmap preview window, if we have
        // already captured bitmap data
        DisplayCapturedBits(Panel2-&gt;Handle,cb.pBuffer, &amp;(cb.bih));

      //  DisplayCapturedBits(Image1,cb.pBuffer, &amp;(cb.bih));

}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &amp;Action)
{
    // Free the memory allocated for our bitmap data buffer
    if (cb.pBuffer != 0)
    {
        delete cb.pBuffer;
        cb.pBuffer = 0;
    }
}
//---------------------------------------------------------------------------
</code></pre>
<p>das teil kopiert den live webcam stream in ein panel, wie bekomme ich jetzt<br />
die roh daten in ein image ? so das ich mit den pixeln weiter arbeiten kann<br />
bin ihrgend wie zu dumm das umzuschreiben kann zwar den stream von dem ding in welchem format auch immer zb aufs form oder auf ein memo feld laden etc..<br />
bekomme aber trozdem net die einzelnen pixel daten <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>hilfe !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1073532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073532</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Thu, 08 Jun 2006 00:53:22 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Thu, 08 Jun 2006 00:55:00 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">//---------------------------------------------------------------------------
#ifndef WDMCapH
#define WDMCapH

//---------------------------------------------------------------------------
#define __comcat_h__ // EXCLUDE COMCAT.H AS IT COLLIDES WITH QEDIT.H
//---------------------------------------------------------------------------
#include &lt;basetsd.h&gt;
#include &lt;malloc.h&gt;
#include &lt;dshow.h&gt;
#include &lt;qedit.h&gt;
#include &lt;uuids.h&gt;
#include &lt;amstream.h&gt;

#if defined(WIN32)
#define FASTCALL  __fastcall
#define _CLOSURE_ __closure
#else
#define FASTCALL  /*__fastcall*/
#define _CLOSURE_ /*__closure*/
#endif
//---------------------------------------------------------------------------
// Application-defined message to notify application's window (hosting output) of filtergraph events
#define WM_GRAPHNOTIFY  (WM_APP+15)
//---------------------------------------------------------------------------
#ifdef _DLL_BUILD_
 #define _DLL_EXPOSURE_  __declspec(dllexport)
#else
 #define _DLL_EXPOSURE_  __declspec(dllimport)
#endif

#ifdef __cpluplus
extern &quot;C&quot;{
#endif
//---------------------------------------------------------------------------
enum PLAYSTATE {Stopped, Paused, Running, Init};
//---------------------------------------------------------------------------
enum WDM_CAPTURE_TYPE {
                       WDM_CAPTURE_PREVIEW,//Preview in window only
                       WDM_CAPTURE_STREAM, //no preview, render to Memory stream
                       WDM_CAPTURE_PREVIEW_STREAM, //preview and render to Memory stream
                       WDM_CAPTURE_AVIFILE,//no preview, capture to avi file
                       WDM_CAPTURE_PREVIEW_AVIFILE //preview and capture to avifile at the same time
                      };
//---------------------------------------------------------------------------
typedef void FASTCALL (*PNotificationSink)(void*);
//---------------------------------------------------------------------------
typedef void FASTCALL (*PCBUFFERCALLBACKSINK)(double,BYTE*,long,long,long);
typedef void FASTCALL (*PCDEVICEENUMCALLBACK) (char*);
//---------------------------------------------------------------------------
//Buffer sink used when capturing to a stream
typedef struct tagSampleRenderSink
{
 PCBUFFERCALLBACKSINK pCallbackSink;
}CSampleCallbackSink,*PCSampleCallbackSink;

typedef void FASTCALL (*DRAWCALLBACK)(HANDLE);
//---------------------------------------------------------------------------
typedef class _DLL_EXPOSURE_ tagWDMCapture
{
 private:
  HWND ghApp;
  DWORD g_dwGraphRegister;
  WDM_CAPTURE_TYPE captype;
  IVideoWindow  * g_pVW;
  IMediaControl * g_pMC;
  IMediaEventEx * g_pME;
  IAMVfwCaptureDialogs *g_pDlg;
  IGraphBuilder * g_pGraph;
  IBaseFilter* g_pSrcFilter;
  ICaptureGraphBuilder2 * g_pCapture;
  PLAYSTATE g_psCurrent;
  IConfigAviMux *g_pConfigAviMux;
  //stream capture stuff
  IBaseFilter* pGrabberBaseFilter;
  ISampleGrabber *pSampleGrabber;
  char* g_Capturefilename;
  PCSampleCallbackSink g_BufferCallbackSink;
  tagWDMCapture(WDM_CAPTURE_TYPE=WDM_CAPTURE_PREVIEW);
  tagWDMCapture(HWND,WDM_CAPTURE_TYPE=WDM_CAPTURE_PREVIEW);
 protected:
  void Msg(TCHAR *szFormat, ...);
  // Remote graph viewing functions
#ifdef REGISTER_FILTERGRAPH
  HRESULT FASTCALL AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister);
  void FASTCALL RemoveGraphFromRot(DWORD pdwRegister);
#endif
  void FASTCALL RegisterForDevChange(void);
  void FASTCALL UnregisterForDevChange(void);
 public:
  static tagWDMCapture* GetWDMCapClassInstance(WDM_CAPTURE_TYPE=WDM_CAPTURE_PREVIEW);
  static tagWDMCapture* GetWDMCapClassInstance(HWND,WDM_CAPTURE_TYPE=WDM_CAPTURE_PREVIEW);
  ~tagWDMCapture(void);
  HRESULT FASTCALL GetInterfaces(void);
  /*
  if capturing to an output file,you can choose to render the file to a MultiMediaStream
  */
//if ur going to use WDM_CAPTURE_AVIFILE u need to provide a target filename
//if u r using WDM_CAPTURE_STREAM then the param is a buffer adress
  HRESULT FASTCALL StartVideo(void* psink=NULL,HWND hPreview=NULL);
  HRESULT FASTCALL StopPreview(bool final=true);
  HRESULT FASTCALL PausePreview(void);
  HRESULT FASTCALL ResumePreview(void);
  HRESULT FASTCALL FindCaptureDevice(IBaseFilter ** ppSrcFilter);
  HRESULT FASTCALL SetupVideoWindow(void);
  HRESULT FASTCALL ChangePreviewState(int nShow);
  HRESULT FASTCALL HandleGraphEvent(WPARAM,LPARAM);
  HRESULT FASTCALL CaptureFilterDlg(void);
  HRESULT FASTCALL CapturePinDlg(void);
  const HWND FASTCALL Handle(void)const;
  void FASTCALL CloseInterfaces(void);
  void FASTCALL ResizeVideoWindow(void);
  HRESULT FASTCALL SetFullScreen(BOOL FullScreenMode);
  void FASTCALL setHandle(HWND);
  void FASTCALL EnumCapDevices( PCDEVICEENUMCALLBACK pDeviceCallbackFunc);
  PNotificationSink OnDataBuffering;
}CWDMCapture,*PCWDMCapture;
//---------------------------------------------------------------------------
#ifdef __cpluplus
}
#endif
//---------------------------------------------------------------------------
#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1073533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1073533</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Thu, 08 Jun 2006 00:55:00 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 11:40:23 GMT]]></title><description><![CDATA[<p>hmm doof, immer noch keine lösung gefunden, kann mir eventuell wer weiter helfen wenn ich das kompette projekt zum downloaden mal on stelle?</p>
<p>der webcam stream wird via handle in die panel 1 und 2 geladen, kann den handle auch aufs form oder auf ne memo setzen dann hab ich das bild dort,</p>
<p>nur wie bekomme ich das in ein image feld ? damit ich dann die einzelnen pixel abgreifen kann !?</p>
<p>hat einer ne idee? komme einfach net weiter und bin ratlos</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074540</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074540</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 11:40:23 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:01:41 GMT]]></title><description><![CDATA[<p>Also ich denke, das Problem ist, daß du ein Windows-Handle benötigst, aber gleichzeitig die Eigenschaft Canvas benutzen willst.<br />
Das einzige Control, das dies standardmäßig unterstützt ist TForm.</p>
<p>Dann kannst du also das Bild von Form-&gt;Canvas abgreifen.</p>
<p>Oder aber du baust dir ein eigenes Control abgeleitet von TCustomControl, da dies sowohl von TWinControl abgeleitet ist als auch die Eigenschaft Canvas besitzt.</p>
<p>Die anderen Controls (Panel, Memo etc.) unterstützen nicht das direkte Auslesen der Pixel.</p>
<p>Du kannst dann Canvas-&gt;CopyRect(...) benutzen, um die Daten in ein Image zu kopieren und dann abzuspeichern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074553</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:01:41 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:16:34 GMT]]></title><description><![CDATA[<p>wenn ichs jetzt aufs tform lade mach mir mal bitte ein beispiel wie es in das image1 dann geht?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074569</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074569</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:16:34 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:26:40 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">Image1-&gt;Width = form-&gt;Width;  // hier noch passende Breite und Höhe bestimmen
Image1-&gt;Height = form-&gt;Height; // falls Form größer als Web-Stream-Image
Rect r = Image1-&gt;ClientRect();
Rect r2 = Form1-&gt;ClientRect();

Image1-&gt;CopyRect(r, Form1-&gt;Canvas, r2);
</code></pre>
<p>Wenn du den letzten Parameter 'r2' veränderst, kannst du den Ausschnitt ändern bzw. das Bild strecken oder stauchen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074586</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074586</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:26:40 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:34:57 GMT]]></title><description><![CDATA[<p>[C++ Error] Unit2.cpp(24): E2335 Overloaded 'Rect' ambiguous in this context<br />
[C++ Error] Unit2.cpp(24): E2379 Statement missing ;<br />
[C++ Error] Unit2.cpp(25): E2335 Overloaded 'Rect' ambiguous in this context<br />
[C++ Error] Unit2.cpp(25): E2379 Statement missing ;<br />
[C++ Error] Unit2.cpp(27): E2316 'CopyRect' is not a member of 'TImage'<br />
[C++ Error] Unit2.cpp(27): E2451 Undefined symbol 'r'<br />
[C++ Error] Unit2.cpp(27): E2451 Undefined symbol 'r2'</p>
<p>bei rec meckert er</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074595</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:34:57 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:39:26 GMT]]></title><description><![CDATA[<p>Image1-&gt;Width = Form1-&gt;Width; // hier noch passende Breite und Höhe bestimmen<br />
Image1-&gt;Height = Form1-&gt;Height; // falls Form größer als Web-Stream-Image<br />
TRect r = Image1-&gt;ClientRect();<br />
TRect r2 = Form1-&gt;ClientRect();<br />
Image1-&gt;CopyRect(r, Form1-&gt;Canvas, r2);</p>
<p>----------------------------------------------------------------</p>
<p>[C++ Error] Unit2.cpp(23): E2314 Call of nonfunction<br />
[C++ Error] Unit2.cpp(24): E2314 Call of nonfunction<br />
[C++ Error] Unit2.cpp(25): E2316 'CopyRect' is not a member of 'TImage'<br />
[C++ Warning] Unit2.cpp(26): W8004 'r2' is assigned a value that is never used<br />
[C++ Warning] Unit2.cpp(26): W8004 'r' is assigned a value that is never used</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074599</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:47:58 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">Image1-&gt;Width = form-&gt;Width;  // hier noch passende Breite und Höhe bestimmen
Image1-&gt;Height = form-&gt;Height; // falls Form größer als Web-Stream-Image
TRect r = Image1-&gt;ClientRect;
TRect r2 = Form1-&gt;ClientRect;

Image1-&gt;Canvas-&gt;CopyRect(r, Form1-&gt;Canvas, r2);
</code></pre>
<p>Warum schreibst du dein Bitmap nich gleich in das Canvas des Images?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074606</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074606</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 12:49:43 GMT]]></title><description><![CDATA[<p>geht das mit dem quellcode direct ohne rec ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074607</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 12:49:43 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 13:02:03 GMT]]></title><description><![CDATA[<p>Ja.<br />
Nimm einfach das ClientRect.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074616</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074616</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Fri, 09 Jun 2006 13:02:03 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 13:15:20 GMT]]></title><description><![CDATA[<p>funzt hab derzeit nur ne cpu auslastung von ca. 20-35%<br />
mal gucken ob ich die ihrgend wie runter bekomme dasist noch bissel viel<br />
gibts ihrgend wie ne möglichkeit die frame rate der cam runter zu bekomme auf 10fps oder so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074625</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 13:15:20 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 13:43:03 GMT]]></title><description><![CDATA[<p>eins wurmt mich wenn ich die funktion raus nehme die zur speicherung der datei als bmp raus nehme funzt nix mehr</p>
<p>hab das gefühl das er jedes frame auf hdd speichert und dann wieder ihrgend wie löd oder so?</p>
<p>kann man den teil mit der hdd speicherung net raus nehmen ? weil den brauch ich mal garnicht..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074633</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 13:43:03 GMT</pubDate></item><item><title><![CDATA[Reply to WebCamStream-&amp;gt;Panel Funzt, und wie bekomme ich das in ein Image ?! on Fri, 09 Jun 2006 17:11:36 GMT]]></title><description><![CDATA[<p><a href="http://www.keksohr.de/index.php?menu=projekt-index-cam-mca-25" rel="nofollow">http://www.keksohr.de/index.php?menu=projekt-index-cam-mca-25</a></p>
<p>hab hier mal alles drin, quelltexte komme auch die tage <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
bei fragen ins gästebuch oder via mail melden,</p>
<p>gruß philip</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1074730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1074730</guid><dc:creator><![CDATA[keksohr666]]></dc:creator><pubDate>Fri, 09 Jun 2006 17:11:36 GMT</pubDate></item></channel></rss>