Re: Interoperability-Frage

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



> (1)Weisst Du zufällig wie ich das in C++ managed bewerkstelligen kann?
> Da gibt es ja kein unsafe/fixed keyword.

in Managed C++ (2005:C++/CLI)
kann man sowieso managed und unmanaged C++ Source 'mischen', u.a. gibts auch IJW.



> (2)Wie übergebe ich eigentlich meinem managed code die Adresse
> ....die Adressübergabe müsste als gemarshallt werden.

Pointer & Handles in C# typisch als Typ: 'IntPtr', nur zB:
http://www.pinvoke.net/default.aspx/gdi32.CreateDIBitmap


Für .NET-Bitmaps, zusammen mit Bitmap.LockBits & unsafe, IntPtr, zB:
http://www.codeproject.com/csharp/quickgrayscale.asp



> Bitmap zu nehmen, und diese in einem WPF Window anzeigen zu lassen?

WPF hat (auch wie GDI+) eigene ('abstraktere') Bitmap und Rendering - Konzepte.
Soweit ich gerade sehe für Einbinden von GDI32-Bitmaps:
System.Windows.Interop.Imaging
CreateBitmapSourceFromHBitmap / CreateBitmapSourceFromMemorySection


> diese Surface dann in managed DirectX
> in den Backpuffer meiner GFX card zu schreiben?

ich vermute auch am ehesten/direktesten möglich mit DirectX (Direct3D ggf älteres DirectDraw),
kenne aber keine Details.


Evtl. auch ein Ansatz,
nur den jeweils sichtbaren Ausschnitt selber per Win32-API in .NET-Window zeichnen,
soweit ich mich erinnere Bsp in (ohne Gewähr):
http://www.codeproject.com/dotnet/twaindotnet.asp
(PicForm.cs OnPaint() : SetDIBitsToDevice)






--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


.



Relevant Pages

  • Re: Why arent you upgrading?
    ... missing a bit of eye candy but it does work without a DirectX ... Yes but "WPF graphical kind of things" is not WPF. ... Well of course Vista doesn't consume XAML to do it's WPF like graphical ... going to Win32 yourself if the Win32 already exists. ...
    (borland.public.delphi.non-technical)
  • Re: best way to replace GDI+ code with hardware acceleration?
    ... My application runs on a scheduler-based physics engine, object positions ... I thought WPF was only hardware accelerated for Vista, ... Your best bet is an older DirectX or OpenGL, ... more likely to run without running into problems of missing libraries (a ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Why arent you upgrading?
    ... missing a bit of eye candy but it does work without a DirectX ... Heck until about 6-8 months ago Vista didn't ... Yes but "WPF graphical kind of things" is not WPF. ... going to Win32 yourself if the Win32 already exists. ...
    (borland.public.delphi.non-technical)
  • Re: There is no .NET in Vista Code?
    ... "...Microsoft appears to have concentrated their development effort in Vista on native code development..." ... You described WPF as a unification, which to me is very interesting, because I haven't heard it describe in quite those terms. ... You're saying that the same way that Windows Communication Foundation is a unification of remoting, Enterprise Services, and Web services, WPF is a unification of Win32, Windows Forms, and DirectX? ... That being said, I wouldn't say that WPF is necessarily a replacement for other technologies, such as DirectX. ...
    (borland.public.delphi.non-technical)