C# WPF uEye Camera capture video -
i have program capture video camera. application in windows form , want use code wpf application not working. use handle capture image ueye camera. in windows form
displayhandle = picturebox.handle
but when use handle in wpf not received video camera. in wpf use handle
hwndsource hwndsource = hwndsource.fromvisual(pbmainimage) hwndsource; displayhandle = hwndsource.handle;
but still not working it
both handle used after
initializecomponent();
private void onframeevent(object sender, eventargs e){ ueye.camera camera = sender ueye.camera; int32 s32memid; camera.memory.getactive(out s32memid); camera.display.render(s32memid, displayhandle, ueye.defines.displayrendermode.fittowindow); }
displayhandle si handle component pictureimage.
thanks help.
hwndsource hwndsource = hwndsource.fromvisual(pbmainimage) hwndsource; displayhandle = hwndsource.handle;
do not use after
initializecomponent();
because hwndsource null camera not recognize handle. can create handle before use handle not after initialize component.
Comments
Post a Comment