Hi,
I think the following code should work:
System.Drawing.Image x = System.Drawing.Image.FromHbitmap(BASS_SFX_PluginRender(hSFX, hStream, hVisDC));
but I get an external Exception.
System.Runtime.InteropServices.ExternalException was unhandled
Message="Allgemeiner Fehler in GDI+."
Source="System.Drawing"
ErrorCode=-2147467259
StackTrace:
bei System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette)
bei System.Drawing.Image.FromHbitmap(IntPtr hbitmap)
bei BASS_SFXTest.frmMain.timer1_Tick(Object sender, EventArgs e) in D:\BASS_SFX\VS 2005\C# .NET\BASS_SFXTest\Form1.cs:Zeile 103.
bei System.Windows.Forms.Timer.OnTick(EventArgs e)
bei System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei BASS_SFXTest.Program.Main() in D:\BASS_SFXTest\Program.cs:Zeile 17.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException:
What I´m doing wrong?
zoidberg