Hello,
I am using the WebCam Control in WinForms (latest Version) and placed it on an empty form. Then I tested this "program" on a Test device (CAT T20 Win10 Tablet). The preview picture in the control does not match the orientation of the device. (depending on which side of the device is at top the visible picture is rotated 90/180 degrees).
For testing purposes I installed the WinForms Example application on the same tablet device with the same results.
How to sync the captured picture to the orientation of the device? In the WPF documentation of the WebCamControl I found a Videoflip method, which is not available in WinForms.
Best regards,
Stefan
01.Exception02. 03.System.NullReferenceException: 'Object reference not set to an instance of an object.'04. 05.Stack trace.06. 07." at MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(BitmapInfoHeader bmi)"08. 09.CallStack10. 11. MediaFoundation.dll!MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(MediaFoundation.Misc.BitmapInfoHeader bmi) Unknown12. MediaFoundation.dll!MediaFoundation.Misc.BMMarshaler.MarshalNativeToManaged(System.IntPtr pNativeData) Unknown13. [Native to Managed Transition] 14. [Managed to Native Transition] 15. Telerik.Windows.MediaFoundation.dll!Telerik.Windows.MediaFoundation.WebCamPresenter.TakeSnapshot() Unknown16. Telerik.WinControls.RadWebCam.dll!Telerik.WinControls.UI.RadWebCam.TakeSnapshot() Unknown17. Telerik.WinControls.RadWebCam.dll!Telerik.WinControls.UI.RadWebCamElement.TakeSnapshot_Click(object sender, System.EventArgs e) Unknown18. Telerik.WinControls.dll!Telerik.WinControls.RadElement.OnClick(System.EventArgs e) Unknown19. Telerik.WinControls.UI.dll!Telerik.WinControls.UI.RadButtonItem.OnClick(System.EventArgs e) Unknown20. Telerik.WinControls.UI.dll!Telerik.WinControls.UI.RadButtonElement.OnClick(System.EventArgs e) Unknown21. Telerik.WinControls.dll!Telerik.WinControls.RadElement.DoClick(System.EventArgs e) Unknown22. Telerik.WinControls.dll!Telerik.WinControls.RadElement.RaiseBubbleEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args) Unknown23. Telerik.WinControls.dll!Telerik.WinControls.RadItem.RaiseBubbleEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args) Unknown24. Telerik.WinControls.dll!Telerik.WinControls.RadElement.RaiseRoutedEvent(Telerik.WinControls.RadElement sender, Telerik.WinControls.RoutedEventArgs args) Unknown25. Telerik.WinControls.dll!Telerik.WinControls.RadElement.DoMouseUp(System.Windows.Forms.MouseEventArgs e) Unknown26. Telerik.WinControls.dll!Telerik.WinControls.ComponentInputBehavior.OnMouseUp(System.Windows.Forms.MouseEventArgs e) Unknown27. Telerik.WinControls.dll!Telerik.WinControls.RadControl.OnMouseUp(System.Windows.Forms.MouseEventArgs e) Unknown28. System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) Unknown29. System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown30. System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) Unknown31. Telerik.WinControls.dll!Telerik.WinControls.RadControl.WndProc(ref System.Windows.Forms.Message m) Unknown32. System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown33. System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Unknown34. System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Unknown35. [Native to Managed Transition] 36. [Managed to Native Transition] 37. System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) Unknown38. System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) Unknown39. System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown40. System.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form) Unknown41. System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) Unknown42.> pulse.move.factories.dll!pulse.move.factories.views.ViewFactory.ShowWebCam(System.Windows.Forms.Form owner) Line 952 C#The exception bubbles up to the ViewFactory.ShowWebCam() method, but it doesn't get trapped by that method's try/catch or in your OnWebCamError event.
To reproduce (a bit random)
Im using a logitech HD C270, usb cam
There's often a period of initialization where the cam shows a white or black screen. Sometimes, pressing the control's capture button during this period causes the exception.
I reproduced it in the telerik Quick Start Framework, web cam app. The following code window is the stack trace of when it happened.
I understand that this is within Media Foundation code, and I'm guessing the capture is asynchronous, but is there any way that your control can catch the error as I know my users will be onto the support department when it happens?
Or is there any way to disable your embedded buttons until an image actually appears? I've tried trapping some paint events within the control but failed.
There's also no indication of what's happening during the initialization period, which has taken 10-20 secs occasionally, so it's very tempting to press those buttons :)
001.See the end of this message for details on invoking 002.just-in-time (JIT) debugging instead of this dialog box.003. 004.************** Exception Text **************005.System.NullReferenceException: Object reference not set to an instance of an object.006. at MediaFoundation.Misc.BitmapInfoHeader.CopyFrom(BitmapInfoHeader bmi)007. at MediaFoundation.Misc.BMMarshaler.MarshalNativeToManaged(IntPtr pNativeData)008. at System.StubHelpers.MngdRefCustomMarshaler.ConvertContentsToManaged(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)009. at MediaFoundation.EVR.IMFVideoDisplayControl.GetCurrentImage(BitmapInfoHeader pBih, IntPtr& pDib, Int32& pcbDib, Int64& pTimeStamp)010. at Telerik.Windows.MediaFoundation.WebCamPresenter.TakeSnapshot()011. at Telerik.WinControls.UI.RadWebCam.TakeSnapshot()012. at Telerik.WinControls.UI.RadWebCamElement.TakeSnapshot_Click(Object sender, EventArgs e)013. at Telerik.WinControls.RadElement.OnClick(EventArgs e)014. at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)015. at Telerik.WinControls.UI.RadButtonElement.OnClick(EventArgs e)016. at Telerik.WinControls.RadElement.DoClick(EventArgs e)017. at Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)018. at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)019. at Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)020. at Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)021. at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)022. at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)023. at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)024. at System.Windows.Forms.Control.WndProc(Message& m)025. at System.Windows.Forms.ScrollableControl.WndProc(Message& m)026. at Telerik.WinControls.RadControl.WndProc(Message& m)027. at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)028. at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)029. at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)030. 031. 032.************** Loaded Assemblies **************033.mscorlib034. Assembly Version: 4.0.0.0035. Win32 Version: 4.7.3468.0 built by: NET472REL1LAST_C036. CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll037.----------------------------------------038.TelerikExamples039. Assembly Version: 2019.3.917.40040. Win32 Version: 2019.3.917.40041. CodeBase: file:///C:/Program%20Files%20(x86)/Progress/Telerik%20UI%20for%20WinForms%20R3%202019/Examples/QuickStart/Bin/TelerikExamples.exe042.----------------------------------------043.System.Windows.Forms044. Assembly Version: 4.0.0.0045. Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C046. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll047.----------------------------------------048.System049. Assembly Version: 4.0.0.0050. Win32 Version: 4.7.3451.0 built by: NET472REL1LAST_C051. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll052.----------------------------------------053.System.Drawing054. Assembly Version: 4.0.0.0055. Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C056. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll057.----------------------------------------058.QuickStart059. Assembly Version: 2019.3.917.40060. Win32 Version: 2019.3.917.40061. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/QuickStart/v4.0_2019.3.917.40__5bb2a467cbec794e/QuickStart.dll062.----------------------------------------063.Telerik.WinControls.UI064. Assembly Version: 2019.3.917.40065. Win32 Version: 2019.3.917.40066. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.UI/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.UI.dll067.----------------------------------------068.System.Core069. Assembly Version: 4.0.0.0070. Win32 Version: 4.7.3468.0 built by: NET472REL1LAST_C071. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll072.----------------------------------------073.Telerik.WinControls074. Assembly Version: 2019.3.917.40075. Win32 Version: 2019.3.917.40076. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.dll077.----------------------------------------078.TelerikCommon079. Assembly Version: 2019.3.917.40080. Win32 Version: 2019.3.917.40081. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/TelerikCommon/v4.0_2019.3.917.40__5bb2a467cbec794e/TelerikCommon.dll082.----------------------------------------083.System.Xml084. Assembly Version: 4.0.0.0085. Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C086. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll087.----------------------------------------088.Telerik.WinControls.Themes.TelerikMetro089. Assembly Version: 2019.3.917.40090. Win32 Version: 2019.3.917.40091. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetro/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetro.dll092.----------------------------------------093.System.Configuration094. Assembly Version: 4.0.0.0095. Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C096. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll097.----------------------------------------098.Microsoft.GeneratedCode099. Assembly Version: 1.0.0.0100. Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C101. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll102.----------------------------------------103.Telerik.WinControls.Themes.Fluent104. Assembly Version: 2019.3.917.40105. Win32 Version: 2019.3.917.40106. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Fluent/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Fluent.dll107.----------------------------------------108.Telerik.WinControls.Themes.FluentDark109. Assembly Version: 2019.3.917.40110. Win32 Version: 2019.3.917.40111. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.FluentDark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.FluentDark.dll112.----------------------------------------113.RadControlSpy114. Assembly Version: 2019.3.917.40115. Win32 Version: 2019.3.917.40116. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/RadControlSpy/v4.0_2019.3.917.40__5bb2a467cbec794e/RadControlSpy.dll117.----------------------------------------118.Telerik.WinControls.Themes.Aqua119. Assembly Version: 2019.3.917.40120. Win32 Version: 2019.3.917.40121. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Aqua/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Aqua.dll122.----------------------------------------123.Telerik.WinControls.Themes.Breeze124. Assembly Version: 2019.3.917.40125. Win32 Version: 2019.3.917.40126. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Breeze/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Breeze.dll127.----------------------------------------128.Telerik.WinControls.Themes.Desert129. Assembly Version: 2019.3.917.40130. Win32 Version: 2019.3.917.40131. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Desert/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Desert.dll132.----------------------------------------133.Telerik.WinControls.Themes.HighContrastBlack134. Assembly Version: 2019.3.917.40135. Win32 Version: 2019.3.917.40136. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.HighContrastBlack/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.HighContrastBlack.dll137.----------------------------------------138.Telerik.WinControls.Themes.Office2007Black139. Assembly Version: 2019.3.917.40140. Win32 Version: 2019.3.917.40141. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2007Black/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2007Black.dll142.----------------------------------------143.Telerik.WinControls.Themes.Office2007Silver144. Assembly Version: 2019.3.917.40145. Win32 Version: 2019.3.917.40146. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2007Silver/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2007Silver.dll147.----------------------------------------148.Telerik.WinControls.Themes.Office2010Black149. Assembly Version: 2019.3.917.40150. Win32 Version: 2019.3.917.40151. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Black/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Black.dll152.----------------------------------------153.Telerik.WinControls.Themes.Office2010Silver154. Assembly Version: 2019.3.917.40155. Win32 Version: 2019.3.917.40156. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Silver/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Silver.dll157.----------------------------------------158.Telerik.WinControls.Themes.Office2010Blue159. Assembly Version: 2019.3.917.40160. Win32 Version: 2019.3.917.40161. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2010Blue/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2010Blue.dll162.----------------------------------------163.Telerik.WinControls.Themes.Office2013Dark164. Assembly Version: 2019.3.917.40165. Win32 Version: 2019.3.917.40166. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2013Dark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2013Dark.dll167.----------------------------------------168.Telerik.WinControls.Themes.Office2013Light169. Assembly Version: 2019.3.917.40170. Win32 Version: 2019.3.917.40171. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Office2013Light/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Office2013Light.dll172.----------------------------------------173.Telerik.WinControls.Themes.TelerikMetroBlue174. Assembly Version: 2019.3.917.40175. Win32 Version: 2019.3.917.40176. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetroBlue/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetroBlue.dll177.----------------------------------------178.Telerik.WinControls.Themes.TelerikMetroTouch179. Assembly Version: 2019.3.917.40180. Win32 Version: 2019.3.917.40181. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.TelerikMetroTouch/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.TelerikMetroTouch.dll182.----------------------------------------183.Telerik.WinControls.Themes.VisualStudio2012Dark184. Assembly Version: 2019.3.917.40185. Win32 Version: 2019.3.917.40186. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.VisualStudio2012Dark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.VisualStudio2012Dark.dll187.----------------------------------------188.Telerik.WinControls.Themes.VisualStudio2012Light189. Assembly Version: 2019.3.917.40190. Win32 Version: 2019.3.917.40191. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.VisualStudio2012Light/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.VisualStudio2012Light.dll192.----------------------------------------193.Telerik.WinControls.Themes.Windows7194. Assembly Version: 2019.3.917.40195. Win32 Version: 2019.3.917.40196. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Windows7/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Windows7.dll197.----------------------------------------198.Telerik.WinControls.Themes.Windows8199. Assembly Version: 2019.3.917.40200. Win32 Version: 2019.3.917.40201. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Windows8/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Windows8.dll202.----------------------------------------203.Telerik.WinControls.Themes.Material204. Assembly Version: 2019.3.917.40205. Win32 Version: 2019.3.917.40206. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Material/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Material.dll207.----------------------------------------208.Telerik.WinControls.Themes.MaterialPink209. Assembly Version: 2019.3.917.40210. Win32 Version: 2019.3.917.40211. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialPink/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialPink.dll212.----------------------------------------213.Telerik.WinControls.Themes.MaterialTeal214. Assembly Version: 2019.3.917.40215. Win32 Version: 2019.3.917.40216. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialTeal/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialTeal.dll217.----------------------------------------218.Telerik.WinControls.Themes.MaterialBlueGrey219. Assembly Version: 2019.3.917.40220. Win32 Version: 2019.3.917.40221. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.MaterialBlueGrey/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.MaterialBlueGrey.dll222.----------------------------------------223.Telerik.WinControls.Themes.Crystal224. Assembly Version: 2019.3.917.40225. Win32 Version: 2019.3.917.40226. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.Crystal/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.Crystal.dll227.----------------------------------------228.Telerik.WinControls.Themes.CrystalDark229. Assembly Version: 2019.3.917.40230. Win32 Version: 2019.3.917.40231. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.Themes.CrystalDark/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.Themes.CrystalDark.dll232.----------------------------------------233.System.Data234. Assembly Version: 4.0.0.0235. Win32 Version: 4.7.3260.0 built by: NET472REL1LAST_C236. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll237.----------------------------------------238.Telerik.WinControls.RadWebCam239. Assembly Version: 2019.3.917.40240. Win32 Version: 2019.3.917.40241. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.RadWebCam/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.RadWebCam.dll242.----------------------------------------243.Telerik.Windows.MediaFoundation244. Assembly Version: 2019.3.910.40245. Win32 Version: 2019.3.910.40246. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.Windows.MediaFoundation/v4.0_2019.3.910.40__5803cfa389c90ce7/Telerik.Windows.MediaFoundation.dll247.----------------------------------------248.Telerik.WinControls.ChartView249. Assembly Version: 2019.3.917.40250. Win32 Version: 2019.3.917.40251. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Telerik.WinControls.ChartView/v4.0_2019.3.917.40__5bb2a467cbec794e/Telerik.WinControls.ChartView.dll252.----------------------------------------253.MediaFoundation254. Assembly Version: 3.1.0.32450255. Win32 Version: 3.1.0.0256. CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/MediaFoundation/v4.0_3.1.0.32450__36fa660e1d6ebf8d/MediaFoundation.dll257.----------------------------------------258. 259.************** JIT Debugging **************260.To enable just-in-time (JIT) debugging, the .config file for this261.application or computer (machine.config) must have the262.jitDebugging value set in the system.windows.forms section.263.The application must also be compiled with debugging264.enabled.265. 266.For example:267. 268.<configuration>269. <system.windows.forms jitDebugging="true" />270.</configuration>271. 272.When JIT debugging is enabled, any unhandled exception273.will be sent to the JIT debugger registered on the computer274.rather than be handled by this dialog box.
Dear,
I'd like to send the webcam stream to another computer, to show live.
How do I do that?
Best,
Jeff
Hi,
I try get the max resolution of the camera hardware on the Surface Pro 4 (SP4) I use as a test platform. Using the default Camera App, under the Settings of the Rear camera, I can pick the highest photo resolution of 8MP, 3264x2448. Even if it is the Front Camera, the 3 resolution options are: 2560x1440 (3.7 mP), 2560x1920 (4.9 MP), 2560x1706 (4.4 MP)
When I use my test App using the RadWebCam, the resolution is only 1920x1440, when I already use the maxFormatIndex of the videoFormats. So I wonder if there are other ways to get the max resolution.
Thanks.
To reproduce, run the sample project that uses the following code snippet:
public partial class MainForm : Telerik.WinControls.UI.RadForm
{
public MainForm()
{
InitializeComponent();
}
private void radButton1_Click(object sender, EventArgs e)
{
using (CameraForm f = new CameraForm())
{
f.ShowDialog();
}
}
} public partial class CameraForm : Telerik.WinControls.UI.RadForm
{
public CameraForm()
{
InitializeComponent();
}
private void CameraForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.radWebCam1.Stop();
}
private void CameraForm_Load(object sender, EventArgs e)
{
ReadOnlyCollection<MediaFoundationDeviceInfo> videoDevices = RadWebCam.GetVideoCaptureDevices();
ReadOnlyCollection<MediaFoundationVideoFormatInfo> videoFormats = RadWebCam.GetVideoFormats(videoDevices[0], true);
radWebCam1.Initialize(videoDevices[0], videoFormats[0]);
radWebCam1.Start();
}
}Note: please have in mind that the issue may not occur the first time you close the CameraForm.
Using FirstLook (also in my application) run the WebCam sample.
Press the takePhotoButton while running youtube video on 2nd monitor (also with netflix, so I assume it's general)
Sound on video pauses and returns when webcam control closed down.
Might be bug, or driver (Im using usb headphones) or needs me to set some property?
Run the sample project. You will observe the following error:
Here is the code snippet:
public RadForm1()
{
InitializeComponent();
this.radWebCam1.AutoStart = false;
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ReadOnlyCollection<MediaFoundationDeviceInfo> videoDevices = RadWebCam.GetVideoCaptureDevices();
ReadOnlyCollection<MediaFoundationVideoFormatInfo> videoFormats = RadWebCam.GetVideoFormats(videoDevices[0], true);
ReadOnlyCollection<MediaFoundationDeviceInfo> audioDevices = RadWebCam.GetAudioCaptureDevices();
radWebCam1.Initialize(videoDevices[0], videoFormats[0], audioDevices[0]);
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
radWebCam1.Start();
} Note: It worked in 2022.1.222.40.
If the feed is paused and I re-size or move the app on my desktop, the camera image also goes blank.
1. Run the project and press Space to pause the camera.
2. Resize the form. You will notice that the paused image gets blank.
Workaround:
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
this.radWebCam1.Resize += RadWebCam1_Resize;
}
Timer t = new Timer();
bool isPaused = false;
private void RadWebCam1_Resize(object sender, EventArgs e)
{
t.Stop();
if (isPaused)
{
t = new Timer();
t.Interval = 100;
t.Tick += T_Tick;
this.radWebCam1.Start();
t.Start();
}
}
private void T_Tick(object sender, EventArgs e)
{
this.radWebCam1.Pause();
isPaused = true;
t.Stop();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Space)
{
this.radWebCam1.Pause();
isPaused = true;
}
return base.ProcessCmdKey(ref msg, keyData);
}