I got the code below from the bitmapmixer sample (DirectShow.NET) and i tried to reimplement it. The original sample works fine. In my version when I try to compile i get errors.
private void AddHandlers()
{
// Add handlers for VMR purpose
this.Paint += new PaintEventHandler(Form1_Paint); // for WM_PAINT
this.Resize += new EventHandler(Form1_ResizeMove); // for WM_SIZE
this.Move += new EventHandler(Form1_ResizeMove); // for WM_MOVE
SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged); // for WM_DISPLAYCHANGE
handlersAdded = true;
}
private void RemoveHandlers()
{
// remove handlers when they are no more needed
handlersAdded = false;
this.Paint -= new PaintEventHandler(Form1_Paint);
this.Resize -= new EventHandler(Form1_ResizeMove);
this.Move -= new EventHandler(Form1_ResizeMove);
SystemEvents.DisplaySettingsChanged -= new EventHandler(SystemEvents_DisplaySettingsChanged);
}
ERRORs
Error 1 The name 'Marshal' does not exist in the current context Form1.cs
Error 2 The name 'Marshal' does not exist in the current context Form1.cs
Error 3 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 4 The name 'Form1_Paint' does not exist in the current context Form1.cs
Error 5 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 6 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 7 The name 'SystemEvents_DisplaySettingsChanged' does not exist in the current context Form1.cs
Error 10 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 11 The name 'SystemEvents_DisplaySettingsChanged' does not exist in the current context Form1.cs
Any help is appreciated.
Thanks.