ratishphilip/CompositionProToolkit

Problem with CompositionImageFrame

Closed this issue · 4 comments

I tried to use CompositionImageFrame in my project.. the build was successful, but I get a runtime error.. I don't have any idea how to fix it.. this is the exception message:

System.TypeLoadException: Requested Windows Runtime type 'Microsoft.Graphics.Canvas.CanvasDevice' is not registered. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

--- End of inner exception stack trace ---
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at Microsoft.Graphics.Canvas.CanvasDevice.GetSharedDevice()
at CompositionProToolkit.CompositionGenerator..ctor(Compositor compositor,

Can you please provide more details on this?
Did you add CompositionProToolkit as a NuGet to your project?
Did it also install the Win2d NuGet along with it?

Could you please share how you are using CompositionImageFrame in your code?

after I added reference to Win2d and rebuilt the solution, that error has gone! sorry sir I thought that Win2d dependency will get referenced automatically as I install CompositionProToolkit nugget..

Sir just one more question, does CompositionImageFrame support caching like ImageEx https://github.com/wasteam/waslibs/tree/master/src/AppStudio.Uwp/Controls/ImageEx
in AppStudio.Uwp or the newer version of it, UWPCommunityToolkit
https://github.com/Microsoft/UWPCommunityToolkit/tree/dev/Microsoft.Toolkit.Uwp.UI.Controls/ImageEx

if it does I believe this control would be one of the best Image control for UWP platform..

Well, it is supposed to add a reference to Win2d automatically when you install the CompositionProToolkit NuGet. I tested here on a new blank UWP app. When you add the CompositionProToolkit Nuget it should show the following dialog
cpt_license

ImageCaching feature is not added to CompositionImageFrame yet. This feature is certainly planned for a future release.

Oh I see.. thanks sir, really looking forward to it!