Click here to Skip to main content
15,901,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralListView Colors..weird Pin
Bengi18-Mar-03 11:10
Bengi18-Mar-03 11:10 
GeneralRe: ListView Colors..weird Pin
Bengi18-Mar-03 23:18
Bengi18-Mar-03 23:18 
GeneralRe: ListView Colors..weird Pin
Alexinuk18-Mar-03 23:23
Alexinuk18-Mar-03 23:23 
GeneralCButton and DialogBar Pin
MemLeak18-Mar-03 10:48
MemLeak18-Mar-03 10:48 
GeneralRe: CButton and DialogBar Pin
Ravi Bhavnani18-Mar-03 10:54
professionalRavi Bhavnani18-Mar-03 10:54 
GeneralRe: CButton and DialogBar Pin
MemLeak19-Mar-03 7:38
MemLeak19-Mar-03 7:38 
GeneralRe: CButton and DialogBar Pin
Ravi Bhavnani19-Mar-03 8:14
professionalRavi Bhavnani19-Mar-03 8:14 
GeneralAviCap Questions Pin
User 1278218-Mar-03 10:13
User 1278218-Mar-03 10:13 
Hello,
I have an application which is using AviCap to occasionally grab a frame from a camera using a frame callback. I would like to convert this frame data into a bitmap or DIB (in memory). For testing purposes I have a static control (m_Pic) declared globally (for ease in testing) in which to display the bitmap to. I know the callback is working correctly because the static control turns black and resizes to the size of the captured imaged.

I've read through the samples here and at a few other places and I'm looking for a very simple method to get the image data without using any sort of custom class. Any help would be appreciated.

Thanks,
Aaron Stubbendieck


LRESULT FAR PASCAL FrameCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)<br />
{<br />
	VOID* data=NULL;<br />
	data=malloc(lpVHdr->dwBytesUsed);<br />
	ZeroMemory(data,lpVHdr->dwBytesUsed);<br />
	memcpy(data,lpVHdr->lpData,lpVHdr->dwBytesUsed);<br />
<br />
	BITMAPINFO BitmapInfo;<br />
	capGetVideoFormat(hWnd,&BitmapInfo,sizeof(BitmapInfo));<br />
<br />
	HBITMAP hBitmap=::CreateDIBSection(0,&BitmapInfo,DIB_RGB_COLORS,&data,NULL,0); <br />
<br />
	CBitmap bmp;<br />
	bmp.Attach(hBitmap);<br />
	m_Pic.SetBitmap(hBitmap);<br />
<br />
	delete data;    //commenting this out makes no difference<br />
<br />
	return (LRESULT)TRUE;<br />
}


modified 12-Jul-20 21:01pm.

GeneralSAPI 5.1 and Win98... Pin
JoeSox18-Mar-03 9:42
JoeSox18-Mar-03 9:42 
GeneralRe: SAPI 5.1 and Win98... Pin
Tim Smith18-Mar-03 9:54
Tim Smith18-Mar-03 9:54 
GeneralRe: SAPI 5.1 and Win98... Pin
JoeSox19-Mar-03 9:43
JoeSox19-Mar-03 9:43 
GeneralVery interesting Question about Compilers Pin
Joel Holdsworth18-Mar-03 9:36
Joel Holdsworth18-Mar-03 9:36 
GeneralRe: Very interesting Question about Compilers Pin
Chris Losinger18-Mar-03 10:31
professionalChris Losinger18-Mar-03 10:31 
GeneralRe: Very interesting Question about Compilers Pin
Joel Holdsworth18-Mar-03 10:45
Joel Holdsworth18-Mar-03 10:45 
GeneralRe: Very interesting Question about Compilers Pin
Neville Franks18-Mar-03 10:55
Neville Franks18-Mar-03 10:55 
GeneralRe: Very interesting Question about Compilers Pin
Joel Holdsworth18-Mar-03 11:26
Joel Holdsworth18-Mar-03 11:26 
GeneralRe: Very interesting Question about Compilers Pin
Neville Franks18-Mar-03 12:29
Neville Franks18-Mar-03 12:29 
GeneralON_THREAD_MESSAGE Pin
clintsinger18-Mar-03 9:20
clintsinger18-Mar-03 9:20 
GeneralRe: ON_THREAD_MESSAGE Pin
Dave Bryant18-Mar-03 9:38
Dave Bryant18-Mar-03 9:38 
QuestionWell, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Joan M18-Mar-03 9:10
professionalJoan M18-Mar-03 9:10 
AnswerRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Dave Bryant18-Mar-03 9:33
Dave Bryant18-Mar-03 9:33 
AnswerRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Tim Smith18-Mar-03 9:34
Tim Smith18-Mar-03 9:34 
GeneralRe: Well, when I use cstringVar.GetBuffer() I need to call ReleaseBuffer, but if I (LPTSTR)(LPCTSTR)cstringVar? Pin
Joan M20-Mar-03 5:05
professionalJoan M20-Mar-03 5:05 
GeneralATL Object Wizard Pin
DuFF18-Mar-03 8:59
DuFF18-Mar-03 8:59 
GeneralCombine multiple images into one Pin
AWebDude18-Mar-03 8:59
AWebDude18-Mar-03 8:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.