Exception while changing screen resolution

Jun 8, 2012 at 12:08 PM
Edited Jun 8, 2012 at 12:09 PM

I'm facing a problem in my GoblinXNA program which is the screen resolution, if im using 480*640 everything is fine and my application is working perfectly

captureDevice.InitVideoCapture(0, FrameRate._60Hz, Resolution._640x480, ImageFormat.R8G8B8_24, false);

but if i change that to 800x600 or 1280x1024 like this:

captureDevice.InitVideoCapture(0, FrameRate._60Hz, Resolution._800x600, ImageFormat.R8G8B8_24, false);


i get an exception

GoblinXNA.GoblinException was unhandled      Message=Could not start video stream    Could not setup graph    Error HRESULT E_FAIL has been returned from a call to a COM component.      Source=GoblinXNA      StackTrace:           at GoblinXNA.Device.Capture.DirectShowCapture.StartupVideo(UCOMIMoniker mon) in C:\GoblinXNAv4.0\src\Device\Capture\DirectShowCapture.cs:line 576           at GoblinXNA.Device.Capture.DirectShowCapture.InitVideoCapture(Int32 videoDeviceID, FrameRate framerate, Resolution resolution, ImageFormat format, Boolean grayscale) in C:\GoblinXNAv4.0\src\Device\Capture\DirectShowCapture.cs:line 276           at Se.HInitialize(Scene scene) in C:\Se\H.cs:line 119           at Se.App.Initialize() in C:\Se\App.cs:line 96           at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)           at Microsoft.Xna.Framework.Game.Run()           at Se.Program.Main(String[] args) in C:\Se\Program.cs:line 15      InnerException: 

any idea how to solve this?
Thank you

Jun 8, 2012 at 1:28 PM

I managed to fix the problem by Changing the resolution in DirectShowCapture.cs to 1280x720


Thank you