Visual C++ .net

Post Reply
avelazquez
Posts: 19
Joined: Mon Jun 07, 2010 7:40 am

Visual C++ .net

Post by avelazquez »

I will like to thank in advance anyone willing to help me; I am trying to get the image displayed in a picturebox using DrawFrame, I am having a hard time figuring out how to get the picture handle. I am using Visual C++ .net, below is a portion of the code I'm using.

waittime = 10; // value in milliseconds; 0 = don't wait; INFINITE = wait till data
running = 6000; // run ~1 minute for waittime=10 ms

while(running--) //!TimeToClose
{
pCamera->GetFrame(waittime, &pFrame);
?//pCamera->DrawFrame(pFrame, pictureBox1);
pFrame->Free();
}

// shut everything down
pCamera->Stop();
pCamera->Close();

CoUninitialize();
Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Visual C++ .net

Post by Birch »

If you have an ID for the picturebox you can use the following example (which draws over a GroupBox frame).

pCamera->DrawFrame(pFrame, (LONG) GetDlgItem(IDC_STATIC_FRAME_IMAGE)->GetSafeHwnd());

Which assumes :
GROUPBOX "",IDC_STATIC_FRAME_IMAGE,147,3,240,340



Also, if there is an issue with the picture box allowing the SDK to paint the image on top of it, then you could alternately try GetFrameImage (search this forum for more posts about that)
Post Reply