Closed FrayxRulez closed 4 years ago
There are multiple different ways to use a WinRT component such as Win2D from C++: C++/CX, C++/WinRT, or WRL. It sounds like you are using C++/CX? The ICanvasBitmapFactory interface is part of the lower level WRL way of accessing these APIs, so not relevant if you are working with C++/CX.
The Array<> class is documented here: https://docs.microsoft.com/en-us/cpp/cppcx/platform-array-class?view=vs-2019
I’m using C++/CX. I would like to avoid using Array<> (that I’m using already) as the method is being invoked 30/60 times per second and I would like to further optimize it.
So that's it: https://github.com/FrayxRulez/RLottie.UWP/commit/fb3766ea8c90d969319164bde3fc860a080d0210
Thanks anyway!
There is no need to drop down to the ABI level here. You can get identical performance (same number of allocations, same number of data copies, etc.) using C++/CX and the Array<> type.
Hello, I'm pretty sure this is a noob question, but I can't figure out myself and I can't find any example or documentation about this on the web. I have a Windows Runtime Component I use to do some images encoding/decoding and I have a method that should output a CanvasBitmap to be rendered by a AnimatedCanvasControl in the C# part of the app. At the moment I'm using
CanvasBitmap::CreateFromBytes
but I think it really makes a little sense to do this, as I need to create aArray<uint8>
when I haveBYTE*
to be consumed, still I can't figure out how to useICanvasBitmapFactory
(that seems to accept a pointer) and I'm not even sure if after I could pass the result back to C# as CanvasBitmap.